develooper Front page | perl.perl5.porters | Postings from May 2012

[perl #112272] link() does not return the correct error on existing files (Win32)

From:
Tony Cook via RT
Date:
May 28, 2012 05:59
Subject:
[perl #112272] link() does not return the correct error on existing files (Win32)
Message ID:
rt-3.6.HEAD-5009-1338209987-1677.112272-15-0@perl.org
On Thu Apr 05 05:01:04 2012, lcons@cpan.org wrote:
> This is a bug report for perl from lcons@cpan.org,
> generated with the help of perlbug 1.39 running under perl 5.14.2.
> 
> This has been seen when using Strawberry Perl on Windows 7.
> 
> When using the link() built-in to link to an existing file, the
> function
> fails and sets $! to EINVAL. On other systems, EEXIST is used.
> 
> This seems to violate the POSIX standard
> (http://pubs.opengroup.org/onli nepubs/009695399/functions/link.html)
> that
> does not even list EINVAL in its list of possible errors.
> 
> Note that, in this case, $^E is set to ERROR_ALREADY_EXISTS (Cannot
> create a file when that file already exists) so the problem may simply
> bet a mapping between $^E and $!.
> 
> This has been initially reported as
> https://rt.cpan.org/Public/Bug/Display.html?id=76324.

Tested and fixed by 23629bd37b27c6af15ae899eccd83273eb1353bb and
2b42d7ed85d297655c1e58d1db212901dc38654f.

Tony


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=112272



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About