Win32::IdentifyFile - Perl extension for to obtain an identity for an NTFS file
use Win32::IdentifyFile qw(:all); @info = IdentifyFile(filename); $info = IdentifyFile(filename); CloseIdentifyFile();
This module returns three items which together uniquely identify a file or directory on Microsoft Windows NTFS. The identity fulfils a similar role to an inode number on UNIX file systems.
The filename specified may be a file or directory, and may be in conventional Windows, relative, or UNC (Universal Naming Convention), formats.
The information returned by IdentifyFile is as follows: Volume Serial Number, File Index High, File Index Low. In list context these are returned as a list. In scalar context these are returned as a single string, joined by ':';
Just getting this information could result in a race condition. The file could be deleted, possibly by another process, between getting the information and using it in a test. Worse, another file might be created with the same file index meanwhile. To prevent this scenario, files (or directories) are opened internally by IdentifyFile(), and kept open until CloseIdentifyFile() is called (files are not physically deleted until all open file handles are closed).
It is important to call CloseIdentifyFile() in order to avoid a resource leak. Only one call is required, regardless of the number of times IdentifyFile() is called.
None by default.
Win32API::File
Clive Darke, <clive.darke@talk21.com> From a suggestion by 'grinder'
Copyright (C) 2008 by Clive Darke
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.
To install Win32::IdentifyFile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Win32::IdentifyFile
CPAN shell
perl -MCPAN -e shell install Win32::IdentifyFile
For more information on module installation, please visit the detailed CPAN module installation guide.