NG::File - File object for NG.
my $f = NG::File->new('/tmp/file'); say $f->fstat;
Return Hashtable or Array:
my $object = NG::File->from_yaml/json($file);
my $filepath = '/home/chenryn/test.conf'; my $content = NG::File->read_file($filepath); NG::File->new('test.txt')->read_file(sub { my ($content) = @_; say $content->get(1); });
read_dir('/root')->each(sub { my $file = shift; read_file( $file, sub { ... }) }); read_dir(qw(/root /tmp), sub{ my ($dir, $file) = @_; ... });
0 dev device number of filesystem 1 ino inode number 2 mode file mode (type and permissions) 3 nlink number of (hard) links to the file 4 uid numeric user ID of file's owner 5 gid numeric group ID of file's owner 6 rdev the device identifier (special files only) 7 size total size of file, in bytes 8 atime last access time in seconds since the epoch 9 mtime last modify time in seconds since the epoch 10 ctime inode change time in seconds since the epoch (*) 11 blksize preferred block size for file system I/O 12 blocks actual number of blocks allocated
To install NG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm NG
CPAN shell
perl -MCPAN -e shell install NG
For more information on module installation, please visit the detailed CPAN module installation guide.