develooper Front page | perl.perl5.porters | Postings from December 2003

Re: [PATCH] Re: perl @ 21830

Thread Previous
From:
Steve Hay
Date:
December 4, 2003 03:56
Subject:
Re: [PATCH] Re: perl @ 21830
Message ID:
3FCF211D.8000909@uk.radan.com
Jody Belka wrote:

>Steve Hay said:
>  
>
>>Rafael Garcia-Suarez wrote:
>>    
>>
>>>Depends. How can we test if two files are identical, link()-wise,
>>>on MSWin32 ? If we can test it, we should fix Copy.pm by adding
>>>another branch to the if() :
>>>   elsif ($^O eq 'MSWin32' && $Config{d_link}) {...}
>>>If we can't, we should fix the test so it's skipped on Windows.
>>>
>>>      
>>>
>>I can't think of any way to test it.  File::Copy uses the inode on other
>>platforms to test hardlinks, but this is always returned as 1 on
>>MSWin32.  The Microsoft documentation for stat() notes: "The inode, and
>>therefore st_ino, has no meaning in the FAT, HPFS, or NTFS file systems."
>>    
>>
>
>There is a way to test this on windows. Basically, you have to get file
>handles for both files using CreateFile, and then call
>GetFileInformationByHandle on both of them.
>
Many thanks for the info -- it's all news to me!

However, AFAIK Perl doesn't have any functions of its own that wrap 
those Win32 API calls.  Neither to do any standard core modules, so 
unless somebody wants to introduce such functions somewhere into Perl it 
will not be possible to do this.  (The libwin32 bundle includes 
Win32API::File which has an interface to CreateFile(), but not 
GetFileInformationByHandle(), and it isn't a core module anyway.)

I think just skipping the test is the best solution for now.

- Steve



------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only.  If you have received this message in error or there are any problems, please notify the sender immediately.  The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden.  Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd.  The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.


Thread Previous


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