Sys::Filesystem::ID
Will read and write an id from a filesystem for data identification purposes.
We create a text file at the root of the mounted filesystem in question- an id file.
This can be used to identify hard drives as they move across computers on a network. If you want to store information about a usb drive in a centralized database. Then you can move the hard drive (with partitions inside) around and you can track them.
A cli (command line interface) application is provided, called fsid, with this distribtution.
None exported by default. This is not an OO interface.
Argument is a device, a mount point, or a file path. Returns id string or undef if not found. Dies if it can't resolve.
get_id('/dev/hda1'); get_id('/mnt/usbdisk'); get_id('home/myself/Desktop/file1.pdf');
Argument is a device, a mount point, or a file path. Returns id string or undef if not found. Dies if it can't resolve, or if the id file already exists.
create_id('/dev/hda1'); create_id('/mnt/usbdisk'); create_id('home/myself/Desktop/file1.pdf');
The ide generated is a random buncha numbers 32 digits. If you want to make your own.. Override _suggest_id_string() in this package.
sub Sys::Filesystem::ID::_suggest_id_string {}
The rule is it must return a string.
You must have write access to create a partition id, and read access to see it. This works on posix only.
Sys::Filesystem
Sys::Filesystem fsid fsidgen
Leo Charre leocharre at cpan dot org
To install Sys::Filesystem::ID, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sys::Filesystem::ID
CPAN shell
perl -MCPAN -e shell install Sys::Filesystem::ID
For more information on module installation, please visit the detailed CPAN module installation guide.