file
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 10155
File 4.21
File attempts to classify files depending on their contents and prints a description if a match is found. more>>
File is the open source implementation of the file command used on almost every free operating system (OpenBSD, Linux, FreeBSD, NetBSD) and also on systems that use free software (including OS/2, DOS, MS Windows, etc.).
The file command, if youre not familiar with it, is a command-line tool that tells you in words what kind of data a file contains. Unlike MS-Windows, UNIX and other systems dont rely on filename extentions to tell you the type of a file, but look at the files actual contents. This is, of course, more reliable, but requires a bit of I/O.
The original file command shipped with Bell Labs UNIX but was unavailable in source form to the masses before Ians reimplementation.
This file command (and magic file) was originally written by Ian Darwin (who still contributes occasionally) and is now maintained by a group of developers lead by Christos Zoulas.
Whos using it?
Every known BSD distribution (FreeBSD, NetBSD, OpenBSD, Darwin/Mac OS X, etc)
Every known Linux distribution
The Apache httpd server mod_mime_magic module uses the file commands innards to make file type guessing more reliable under Apache HTTPD.
<<lessThe file command, if youre not familiar with it, is a command-line tool that tells you in words what kind of data a file contains. Unlike MS-Windows, UNIX and other systems dont rely on filename extentions to tell you the type of a file, but look at the files actual contents. This is, of course, more reliable, but requires a bit of I/O.
The original file command shipped with Bell Labs UNIX but was unavailable in source form to the masses before Ians reimplementation.
This file command (and magic file) was originally written by Ian Darwin (who still contributes occasionally) and is now maintained by a group of developers lead by Christos Zoulas.
Whos using it?
Every known BSD distribution (FreeBSD, NetBSD, OpenBSD, Darwin/Mac OS X, etc)
Every known Linux distribution
The Apache httpd server mod_mime_magic module uses the file commands innards to make file type guessing more reliable under Apache HTTPD.
Download (0.53MB)
Added: 2007-05-25 License: GPL (GNU General Public License) Price:
535 downloads
Get File 1.2.2
Get File is a Firefox extension that can get a file from an URL. more>>
Get File is a Firefox extension that can get a file from an URL.
To use this extension, go in File menu and choose "Get a File".
Ive also developed a french freeware for supervision of your computer.
http://www.pastouchexp.info/
<<lessTo use this extension, go in File menu and choose "Get a File".
Ive also developed a french freeware for supervision of your computer.
http://www.pastouchexp.info/
Download (0.014MB)
Added: 2007-07-09 License: MPL (Mozilla Public License) Price:
875 downloads
Tie::File 0.96
Tie::File can access the lines of a disk file via a Perl array. more>>
Tie::File can access the lines of a disk file via a Perl array.
SYNOPSIS
# This file documents Tie::File version 0.96
use Tie::File;
tie @array, Tie::File, filename or die ...;
$array[13] = blah; # line 13 of the file is now blah
print $array[42]; # display line 42 of the file
$n_recs = @array; # how many records are in the file?
$#array -= 2; # chop two records off the end
for (@array) {
s/PERL/Perl/g; # Replace PERL with Perl everywhere in the file
}
# These are just like regular push, pop, unshift, shift, and splice
# Except that they modify the file in the way you would expect
push @array, new recs...;
my $r1 = pop @array;
unshift @array, new recs...;
my $r2 = shift @array;
@old_recs = splice @array, 3, 7, new recs...;
untie @array; # all finished
Tie::File represents a regular text file as a Perl array. Each element in the array corresponds to a record in the file. The first line of the file is element 0 of the array; the second line is element 1, and so on.
The file is not loaded into memory, so this will work even for gigantic files. Changes to the array are reflected in the file immediately. Lazy people and beginners may now stop reading the manual.
<<lessSYNOPSIS
# This file documents Tie::File version 0.96
use Tie::File;
tie @array, Tie::File, filename or die ...;
$array[13] = blah; # line 13 of the file is now blah
print $array[42]; # display line 42 of the file
$n_recs = @array; # how many records are in the file?
$#array -= 2; # chop two records off the end
for (@array) {
s/PERL/Perl/g; # Replace PERL with Perl everywhere in the file
}
# These are just like regular push, pop, unshift, shift, and splice
# Except that they modify the file in the way you would expect
push @array, new recs...;
my $r1 = pop @array;
unshift @array, new recs...;
my $r2 = shift @array;
@old_recs = splice @array, 3, 7, new recs...;
untie @array; # all finished
Tie::File represents a regular text file as a Perl array. Each element in the array corresponds to a record in the file. The first line of the file is element 0 of the array; the second line is element 1, and so on.
The file is not loaded into memory, so this will work even for gigantic files. Changes to the array are reflected in the file immediately. Lazy people and beginners may now stop reading the manual.
Download (0.066MB)
Added: 2006-06-12 License: Perl Artistic License Price:
1229 downloads
File::stat 0.1
File::stat is a by-name interface to Perls built-in stat() functions. more>>
File::stat is a by-name interface to Perls built-in stat() functions.
SYNOPSIS
use File::stat;
$st = stat($file) or die "No $file: $!";
if ( ($st->mode & 0111) && $st->nlink > 1) ) {
print "$file is executable with lotsa linksn";
}
use File::stat qw(:FIELDS);
stat($file) or die "No $file: $!";
if ( ($st_mode & 0111) && $st_nlink > 1) ) {
print "$file is executable with lotsa linksn";
}
This modules default exports override the core stat() and lstat() functions, replacing them with versions that return "File::stat" objects. This object has methods that return the similarly named structure field name from the stat(2) function; namely, dev, ino, mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, blksize, and blocks.
You may also import all the structure fields directly into your namespace as regular variables using the :FIELDS import tag. (Note that this still overrides your stat() and lstat() functions.) Access these fields as variables named with a preceding st_ in front their method names. Thus, $stat_obj->dev() corresponds to $st_dev if you import the fields.
To access this functionality without the core overrides, pass the use an empty import list, and then access function functions with their full qualified names. On the other hand, the built-ins are still available via the CORE:: pseudo-package.
<<lessSYNOPSIS
use File::stat;
$st = stat($file) or die "No $file: $!";
if ( ($st->mode & 0111) && $st->nlink > 1) ) {
print "$file is executable with lotsa linksn";
}
use File::stat qw(:FIELDS);
stat($file) or die "No $file: $!";
if ( ($st_mode & 0111) && $st_nlink > 1) ) {
print "$file is executable with lotsa linksn";
}
This modules default exports override the core stat() and lstat() functions, replacing them with versions that return "File::stat" objects. This object has methods that return the similarly named structure field name from the stat(2) function; namely, dev, ino, mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, blksize, and blocks.
You may also import all the structure fields directly into your namespace as regular variables using the :FIELDS import tag. (Note that this still overrides your stat() and lstat() functions.) Access these fields as variables named with a preceding st_ in front their method names. Thus, $stat_obj->dev() corresponds to $st_dev if you import the fields.
To access this functionality without the core overrides, pass the use an empty import list, and then access function functions with their full qualified names. On the other hand, the built-ins are still available via the CORE:: pseudo-package.
Download (14.2MB)
Added: 2007-04-27 License: Perl Artistic License Price:
910 downloads
File Lister 2.3
File Lister provides a Web interface for listing files and directories. more>>
File Lister provides a Web interface for listing files and directories.
FileLister is meant to be an open source alternative for listing files/directories with an easy navigateable (web-)interface.
<<lessFileLister is meant to be an open source alternative for listing files/directories with an easy navigateable (web-)interface.
Download (0.034MB)
Added: 2007-02-07 License: GPL (GNU General Public License) Price:
992 downloads
File::Util 3.22
File::Util is an easy, versatile, portable file handling module. more>>
File::Util is an easy, versatile, portable file handling module.
File::Util provides a comprehensive toolbox of utilities to automate all kinds of common tasks on file / directories. Its purpose is to do so in the most portable manner possible so that users of this module wont have to worry about whether their programs will work on other OSes and machines.
SYNOPSIS
use File::Util;
my($f) = File::Util->new();
my($content) = $f->load_file(foo.txt);
$content =~ s/this/that/g;
$f->write_file(
file => bar.txt,
content => $content,
bitmask => 0644
);
$f->write_file(
file => file.bin, content => $binary_content, --binmode
);
my(@lines) = $f->load_file(randomquote.txt, --as-lines);
my($line) = int(rand(scalar @lines));
print $lines[$line];
my(@files) = $f->list_dir(/var/tmp, qw/ --files-only --recurse /);
my(@textfiles) = $f->list_dir(/var/tmp, --pattern=.txt$);
if ($f->can_write(wibble.log)) {
my($HANDLE) = $f->open_handle(
file => wibble.log,
mode => append
);
print $HANDLE "Hello World! Its ", scalar localtime;
close $HANDLE
}
my($log_line_count) = $f->line_count(/var/log/httpd/access_log);
print "My file has a bitmask of " . $f->bitmask(my.file);
print "My file is a " . join(, , $f->file_type(my.file)) . " file."
warn This file is binary! if $f->isbin(my.file);
print "My file was last modified on " .
scalar localtime($f->last_modified(my.file));
# ...and _lots_ more
<<lessFile::Util provides a comprehensive toolbox of utilities to automate all kinds of common tasks on file / directories. Its purpose is to do so in the most portable manner possible so that users of this module wont have to worry about whether their programs will work on other OSes and machines.
SYNOPSIS
use File::Util;
my($f) = File::Util->new();
my($content) = $f->load_file(foo.txt);
$content =~ s/this/that/g;
$f->write_file(
file => bar.txt,
content => $content,
bitmask => 0644
);
$f->write_file(
file => file.bin, content => $binary_content, --binmode
);
my(@lines) = $f->load_file(randomquote.txt, --as-lines);
my($line) = int(rand(scalar @lines));
print $lines[$line];
my(@files) = $f->list_dir(/var/tmp, qw/ --files-only --recurse /);
my(@textfiles) = $f->list_dir(/var/tmp, --pattern=.txt$);
if ($f->can_write(wibble.log)) {
my($HANDLE) = $f->open_handle(
file => wibble.log,
mode => append
);
print $HANDLE "Hello World! Its ", scalar localtime;
close $HANDLE
}
my($log_line_count) = $f->line_count(/var/log/httpd/access_log);
print "My file has a bitmask of " . $f->bitmask(my.file);
print "My file is a " . join(, , $f->file_type(my.file)) . " file."
warn This file is binary! if $f->isbin(my.file);
print "My file was last modified on " .
scalar localtime($f->last_modified(my.file));
# ...and _lots_ more
Download (0.041MB)
Added: 2007-08-08 License: Perl Artistic License Price:
808 downloads
File::Repl 1.20
File::Repl is a Perl module that provides file replication utilities. more>>
File::Repl is a Perl module that provides file replication utilities.
SYNOPSIS
use File::Repl;
%con = {
dira => C:/perl,
dirb => M:/perl,
verbose => 1,
age => 10,
};
$ref=File::Repl->New(%con);
$r1 = $ref->Update(.p(l|m),ab,1);
$r2 = $ref->Update(.t.*,ab,1,.tmp$);
The File:Repl provides simple file replication and management utilities. Its main functions are
File Replication
Allowing two directory structures to be maintained, ensuring files that meet selection logic criteria are mirrored and otherwise synchronized.
Bulk Renaming
Allowing files in a directory structure to be renamed according to the selection logic.
Compressing
Allowing files in a directory structure to be compressed according to a given logic.
Process
Run a common perl process against files in a directory structure according to selection logic.
Deletion
Allowing files in a directory structure to be deleted according to the selection logic.
<<lessSYNOPSIS
use File::Repl;
%con = {
dira => C:/perl,
dirb => M:/perl,
verbose => 1,
age => 10,
};
$ref=File::Repl->New(%con);
$r1 = $ref->Update(.p(l|m),ab,1);
$r2 = $ref->Update(.t.*,ab,1,.tmp$);
The File:Repl provides simple file replication and management utilities. Its main functions are
File Replication
Allowing two directory structures to be maintained, ensuring files that meet selection logic criteria are mirrored and otherwise synchronized.
Bulk Renaming
Allowing files in a directory structure to be renamed according to the selection logic.
Compressing
Allowing files in a directory structure to be compressed according to a given logic.
Process
Run a common perl process against files in a directory structure according to selection logic.
Deletion
Allowing files in a directory structure to be deleted according to the selection logic.
Download (0.015MB)
Added: 2007-06-28 License: Perl Artistic License Price:
849 downloads
Daizu::File 0.3
Daizu::File is a Perl class representing files in working copies. more>>
Daizu::File is a Perl class representing files in working copies.
Each object of this class represents a particular file in a Daizu CMS working copy (a record in the wc_file table).
METHODS
Note that all the functions which return the value of a Subversion property will strip leading and trailing whitespace, and treat a value which is empty or entirely whitespace as if it wasnt set at all.
Daizu::File->new($cms, $file_id)
Return a new Daizu::File object for the file with the specified ID number.
$file->data
Return a reference to a string containing the file data (content).
$file->wc
Return a Daizu::Wc object representing the working copy in which this file lives.
$file->guid_uri
Return the GUID URI for this file.
$file->directory_path
Returns the path of a directory, either the same as the file if its a directory itself, or the path of its parent directory, or if its at the top level.
$file->permalink
Returns the first URL generated by the file, which will be the URL you want to link to most of the time. For articles this will always be the normal HTML version of the article, even if there are also other URLs available for it, and it will always be the first page of multipage articles. For non-article files there is no guarantee about what this will return, but most will only generate a single URL anyway, and for those that dont generators are likely to return the most linkable URL first.
The URL returned is an absolute URL provided as a URI object.
Returns nothing if the file doesnt generate any URLs.
There are some cases where this might not be what you want. For example, the root directory of a website using Daizu::Gen will either not generate a URL at all, or will generate one for a Google sitemap XML file, neither of which is likely to be useful for linking. To get the URL of the website you would probably need to find a file called something like _index.html. On the other hand, the Daizu::Gen::Blog generator will give you a sensible URL for the blog homepage if you call this on its root directory.
$file->urls_in_db($method, $argument)
Return a list of the URLs (plain strings, each an absolute URI) of the file which have the specified method and argument values, drawing from the url table in the database.
$file->article_urls
Return information about the URLs which the file should have, if it is an article. Fails if it isnt.
<<lessEach object of this class represents a particular file in a Daizu CMS working copy (a record in the wc_file table).
METHODS
Note that all the functions which return the value of a Subversion property will strip leading and trailing whitespace, and treat a value which is empty or entirely whitespace as if it wasnt set at all.
Daizu::File->new($cms, $file_id)
Return a new Daizu::File object for the file with the specified ID number.
$file->data
Return a reference to a string containing the file data (content).
$file->wc
Return a Daizu::Wc object representing the working copy in which this file lives.
$file->guid_uri
Return the GUID URI for this file.
$file->directory_path
Returns the path of a directory, either the same as the file if its a directory itself, or the path of its parent directory, or if its at the top level.
$file->permalink
Returns the first URL generated by the file, which will be the URL you want to link to most of the time. For articles this will always be the normal HTML version of the article, even if there are also other URLs available for it, and it will always be the first page of multipage articles. For non-article files there is no guarantee about what this will return, but most will only generate a single URL anyway, and for those that dont generators are likely to return the most linkable URL first.
The URL returned is an absolute URL provided as a URI object.
Returns nothing if the file doesnt generate any URLs.
There are some cases where this might not be what you want. For example, the root directory of a website using Daizu::Gen will either not generate a URL at all, or will generate one for a Google sitemap XML file, neither of which is likely to be useful for linking. To get the URL of the website you would probably need to find a file called something like _index.html. On the other hand, the Daizu::Gen::Blog generator will give you a sensible URL for the blog homepage if you call this on its root directory.
$file->urls_in_db($method, $argument)
Return a list of the URLs (plain strings, each an absolute URI) of the file which have the specified method and argument values, drawing from the url table in the database.
$file->article_urls
Return information about the URLs which the file should have, if it is an article. Fails if it isnt.
Download (0.41MB)
Added: 2006-11-29 License: Perl Artistic License Price:
1059 downloads
File-center 0.3
File-center is a simple Web application to download and upload files. more>>
File-center is a simple Web application to download and upload files. Its interface is very simple, and the scripts to download and upload are simple too.
File-center uses the PATH_INFO to pass the name of the directory or of the file in the URL.
<<lessFile-center uses the PATH_INFO to pass the name of the directory or of the file in the URL.
Download (0.006MB)
Added: 2007-05-18 License: GPL (GNU General Public License) Price:
891 downloads
File::Sync 0.09
File::Sync is a Perl access to fsync() and sync() function calls. more>>
File::Sync is a Perl access to fsync() and sync() function calls.
SYNOPSIS
use File::Sync qw(fsync sync);
fsync(*FILEHANDLE) or die "fsync: $!";
sync();
use File::Sync qw(fsync);
use IO::File;
$fh = IO::File->new("> /tmp/foo")
or die "new IO::File: $!";
...
fsync($fh) or die "fsync: $!";
The fsync() function takes a Perl file handle as its only argument, and passes its fileno() to the C function fsync(). It returns undef on failure, or true on success.
The fsync_fd() function is used internally by fsync(); it takes a file descriptor as its only argument.
The sync() function is identical to the C function sync().
This module does not export any methods by default, but fsync() is made available as a method of the FileHandle and IO::Handle classes.
<<lessSYNOPSIS
use File::Sync qw(fsync sync);
fsync(*FILEHANDLE) or die "fsync: $!";
sync();
use File::Sync qw(fsync);
use IO::File;
$fh = IO::File->new("> /tmp/foo")
or die "new IO::File: $!";
...
fsync($fh) or die "fsync: $!";
The fsync() function takes a Perl file handle as its only argument, and passes its fileno() to the C function fsync(). It returns undef on failure, or true on success.
The fsync_fd() function is used internally by fsync(); it takes a file descriptor as its only argument.
The sync() function is identical to the C function sync().
This module does not export any methods by default, but fsync() is made available as a method of the FileHandle and IO::Handle classes.
Download (0.004MB)
Added: 2006-06-29 License: Perl Artistic License Price:
1213 downloads
File::Data 1.12
File::Data is a Perl module as a interface to file data. more>>
File::Data is a Perl module as a interface to file data.
Wraps all the accessing of a file into a convenient set of calls for reading and writing data, including a simple regex interface.
Note that the file needs to exist prior to using this module!
See new()
SYNOPSIS
use strict;
use File::Data;
my $o_dat = File::Data->new(./t/example);
$o_dat->write("complete file contentsn");
$o_dat->prepend("first linen"); # line 0
$o_dat->append("original second (last) linen");
$o_dat->insert(2, "new second linen"); # inc. zero!
$o_dat->replace(line, LINE);
print $o_dat->READ;
Or, perhaps more seriously :-}
my $o_sgm = File::Data->new(./sgmlfile);
print "new SGML data: ".$o_sgm->REPLACE(
s*((?s).*)s* ,
qq| key="val" |,
) if $o_sgm;
See METHODS and EXAMPLES.
IMPORTANT
lowercase method calls return the object itself, so you can chain calls.
my $o_obj = $o_dat->read; # ! READ; # !<<less
Wraps all the accessing of a file into a convenient set of calls for reading and writing data, including a simple regex interface.
Note that the file needs to exist prior to using this module!
See new()
SYNOPSIS
use strict;
use File::Data;
my $o_dat = File::Data->new(./t/example);
$o_dat->write("complete file contentsn");
$o_dat->prepend("first linen"); # line 0
$o_dat->append("original second (last) linen");
$o_dat->insert(2, "new second linen"); # inc. zero!
$o_dat->replace(line, LINE);
print $o_dat->READ;
Or, perhaps more seriously :-}
my $o_sgm = File::Data->new(./sgmlfile);
print "new SGML data: ".$o_sgm->REPLACE(
s*((?s).*)s* ,
qq| key="val" |,
) if $o_sgm;
See METHODS and EXAMPLES.
IMPORTANT
lowercase method calls return the object itself, so you can chain calls.
my $o_obj = $o_dat->read; # ! READ; # !<<less
Download (0.013MB)
Added: 2007-04-26 License: Perl Artistic License Price:
914 downloads
File::Size 0.06
File::Size is a Perl module to get the size of files and directories. more>>
SYNOPSIS
Get the size for directory /etc/ with the block size of 1024 while following symbolic links:
my $obj = File::Size->new(
dir => /etc/,
blocksize => 1024,
followsymlinks => 1,
humanreadable => 1
);
print $obj->getsize(), "n";
File::Size is used to get the size of files and directories.
There are 6 methods you can use:
new
There are 4 optional hash values for the new() method:
dir
The directory you want the module to get the size for it. Default is current working directory.
blocksize
The blocksize for the output of getsize() method. default is 1 (output in bytes).
followsymlinks
If you want to follow symlinks for directories and files, use this option. The default is not to follow symlinks.
humanreadable
If you want output size in human readable format (e.g. 2048 -> 2.0K), set this option to 1.
You dont have to specify any of those options, which means this is okay:
print File::Size->new()->getsize(), " bytesn";
This is okay too:
print File::Size->new()->setdir( /etc/ )->setblocksize( 1024**2 )->getsize(), " MBn";
setdir
Used to set (or get - if called without parameters) the directory. Example: $obj->setdir( /etc/ );
setblocksize
Used to set (or get - if called without parameters) the block size. Example: $obj->setblocksize( 1024 );
setfollowsymlinks
Used to set if you want to follow symbolic links or not. If called without parmeters, returns the current state. Example: $obj->setfollowsymlinks( 1 );
sethumanreadable
Used to set (or get - if called without parameters) if you want human-readable output sizes. Example: $obj->sethumanreadable( 1 );
getsize
Used to calculate the total size of the directory. Prints output according to the block size you did or didnt specify.
Download (0.003MB)
Added: 2007-04-30 License: Perl Artistic License Price:
907 downloads
File::lockf 0.20
File::lockf is a Perl module interface to the lockf system call. more>>
File::lockf is a Perl module interface to the lockf system call.
SYNOPSIS
use File::lockf;
File-Lockf is an interface to the lockf system call. Perl supports the flock system call natively, but that does not acquire network locks. Perl also supports the fcntl system call, but that is somewhat ugly to use. There are other locking modules available for Perl, but none of them provided what I wanted -- a simple, clean interface to the lockf system call, without any bells or whistles getting in the way.
File-Lockf contains four functions which map directly to the four modes of lockf, and an OO wrapper class that encapulates the basic locking functionality along with an additional utility method that iteratively attempts to acquire a lock.
Lock functions
The following functions return 0 (zero) on success, and the system error number from errno on failure. They each take an open file handle as the first argument, and optionally a size parameter. Please see your system lockf man page for more details about lockf functionality on your system.
$status = File::lockf::lock(FH, size = 0)
This function maps to the F_LOCK mode of lockf.
$status = File::lockf::tlock(FH, size = 0)
This function maps to the F_TLOCK mode of lockf.
$status = File::lockf::ulock(FH, size = 0)
This function maps to the F_ULOCK mode of lockf.
$status = File::lockf::test(FH, size = 0)
This function maps to the F_TEST mode of lockf.
OO wrapper
File-Lockf also provides a simple OO wrapper class around the locking functionality, which allows you to create a lock object for a file handle and then perform lock operations with it. All of the methods return 0 (zero) on success, and the system error number from errno on failure.
$lock = new File::lockf(*FH)
This function returns a new lock object bound to the given file handle. Note that you need to pass a reference to the file handle to the constructor, not the file handle itself.
$status = $lock->lock(size = 0)
This method calls File::lockf::lock on the bound file handle.
$status = $lock->tlock(size = 0)
This method calls File::lockf::tlock on the bound file handle.
$status = $lock->ulock(size = 0)
This method calls File::lockf::ulock on the bound file handle.
$status = $lock->test(size = 0)
This method calls File::lockf::test on the bound file handle.
$status = $lock->slock(count = 5, delay = 2, size = 0)
This method will attempt to lock the bound file handle < count > times, sleeping < delay > seconds after each try. It will return 0 if the lock succeeded, or the system error number from errno if all attempts fail.
<<lessSYNOPSIS
use File::lockf;
File-Lockf is an interface to the lockf system call. Perl supports the flock system call natively, but that does not acquire network locks. Perl also supports the fcntl system call, but that is somewhat ugly to use. There are other locking modules available for Perl, but none of them provided what I wanted -- a simple, clean interface to the lockf system call, without any bells or whistles getting in the way.
File-Lockf contains four functions which map directly to the four modes of lockf, and an OO wrapper class that encapulates the basic locking functionality along with an additional utility method that iteratively attempts to acquire a lock.
Lock functions
The following functions return 0 (zero) on success, and the system error number from errno on failure. They each take an open file handle as the first argument, and optionally a size parameter. Please see your system lockf man page for more details about lockf functionality on your system.
$status = File::lockf::lock(FH, size = 0)
This function maps to the F_LOCK mode of lockf.
$status = File::lockf::tlock(FH, size = 0)
This function maps to the F_TLOCK mode of lockf.
$status = File::lockf::ulock(FH, size = 0)
This function maps to the F_ULOCK mode of lockf.
$status = File::lockf::test(FH, size = 0)
This function maps to the F_TEST mode of lockf.
OO wrapper
File-Lockf also provides a simple OO wrapper class around the locking functionality, which allows you to create a lock object for a file handle and then perform lock operations with it. All of the methods return 0 (zero) on success, and the system error number from errno on failure.
$lock = new File::lockf(*FH)
This function returns a new lock object bound to the given file handle. Note that you need to pass a reference to the file handle to the constructor, not the file handle itself.
$status = $lock->lock(size = 0)
This method calls File::lockf::lock on the bound file handle.
$status = $lock->tlock(size = 0)
This method calls File::lockf::tlock on the bound file handle.
$status = $lock->ulock(size = 0)
This method calls File::lockf::ulock on the bound file handle.
$status = $lock->test(size = 0)
This method calls File::lockf::test on the bound file handle.
$status = $lock->slock(count = 5, delay = 2, size = 0)
This method will attempt to lock the bound file handle < count > times, sleeping < delay > seconds after each try. It will return 0 if the lock succeeded, or the system error number from errno if all attempts fail.
Download (0.003MB)
Added: 2007-04-27 License: Perl Artistic License Price:
911 downloads
File::Xcopy 0.12
File::Xcopy can copy files after comparing them. more>>
File::Xcopy can copy files after comparing them.
SYNOPSIS
use File::Xcopy;
my $fx = new File::Xcopy;
$fx->from_dir("/from/dir");
$fx->to_dir("/to/dir");
$fx->fn_pat((.pl|.txt)$); # files with pl & txt extensions
$fx->param(s,1); # search recursively to sub dirs
$fx->param(verbose,1); # search recursively to sub dirs
$fx->param(log_file,/my/log/file.log);
my ($sr, $rr) = $fx->get_stat;
$fx->xcopy; # or
$fx->execute(copy);
# the same with short name
$fx->xcp("from_dir", "to_dir", "file_name_pattern");
The File::Xcopy module provides two basic functions, xcopy and xmove, which are useful for coping and/or moving a file or files in a directory from one place to another. It mimics some of behaviours of xcopy in DOS but with more functions and options.
The differences between xcopy and copy are:
- xcopy searches files based on file name pattern if the pattern is specified.
- xcopy compares the timestamp and size of a file before it copies.
- xcopy takes different actions if you tell it to.
The Constructor new(%arg)
Without any input, i.e., new(), the constructor generates an empty object with default values for its parameters.
If any argument is provided, the constructor expects them in the name and value pairs, i.e., in a hash array.
<<lessSYNOPSIS
use File::Xcopy;
my $fx = new File::Xcopy;
$fx->from_dir("/from/dir");
$fx->to_dir("/to/dir");
$fx->fn_pat((.pl|.txt)$); # files with pl & txt extensions
$fx->param(s,1); # search recursively to sub dirs
$fx->param(verbose,1); # search recursively to sub dirs
$fx->param(log_file,/my/log/file.log);
my ($sr, $rr) = $fx->get_stat;
$fx->xcopy; # or
$fx->execute(copy);
# the same with short name
$fx->xcp("from_dir", "to_dir", "file_name_pattern");
The File::Xcopy module provides two basic functions, xcopy and xmove, which are useful for coping and/or moving a file or files in a directory from one place to another. It mimics some of behaviours of xcopy in DOS but with more functions and options.
The differences between xcopy and copy are:
- xcopy searches files based on file name pattern if the pattern is specified.
- xcopy compares the timestamp and size of a file before it copies.
- xcopy takes different actions if you tell it to.
The Constructor new(%arg)
Without any input, i.e., new(), the constructor generates an empty object with default values for its parameters.
If any argument is provided, the constructor expects them in the name and value pairs, i.e., in a hash array.
Download (0.015MB)
Added: 2007-08-07 License: Perl Artistic License Price:
810 downloads
Config::File 1.4
Config::File is a Perl module to parse a simple configuration file. more>>
Config::File is a Perl module to parse a simple configuration file.
SYNOPSIS
use Config::File;
my $config_hash = Config::File::read_config_file($configuration_file);
read_config_file parses a simple configuration file and stores its values in an anonymous hash reference. The syntax of the configuration file is quite simple:
# This is a comment
VALUE_ONE = foo
VALUE_TWO = $VALUE_ONE/bar
VALUE_THREE = The value contains a # (hash). # This is a comment.
Options can be clustered when creating groups:
CLUSTER_ONE[data] = data cluster one
CLUSTER_ONE[value] = value cluster one
CLUSTER_TWO[data] = data cluster two
CLUSTER_TWO[value] = value cluster two
Then values can be fetched using this syntax:
$hash_config->{CLUSTER_ONE}{data};
There can be as many sub-options in a cluster as needed.
BIG_CLUSTER[part1][part2][part3] = data
is fetched by: $hash_config->{BIG_CLUSTER}{part1}{part2}{part3};
There are a couple of restrictions as for the names of the keys. First of all, all the characters should be alphabetic, numeric, underscores or hyphens, with square brackets allowed for the clustering. That is, the keys should conform to /^[A-Za-z0-9_-]+$/
This means also that no space is allowed in the key part of the line.
CLUSTER_ONE[data] = data cluster one # Right
CLUSTER_ONE[ data ] = data cluster one # Wrong
<<lessSYNOPSIS
use Config::File;
my $config_hash = Config::File::read_config_file($configuration_file);
read_config_file parses a simple configuration file and stores its values in an anonymous hash reference. The syntax of the configuration file is quite simple:
# This is a comment
VALUE_ONE = foo
VALUE_TWO = $VALUE_ONE/bar
VALUE_THREE = The value contains a # (hash). # This is a comment.
Options can be clustered when creating groups:
CLUSTER_ONE[data] = data cluster one
CLUSTER_ONE[value] = value cluster one
CLUSTER_TWO[data] = data cluster two
CLUSTER_TWO[value] = value cluster two
Then values can be fetched using this syntax:
$hash_config->{CLUSTER_ONE}{data};
There can be as many sub-options in a cluster as needed.
BIG_CLUSTER[part1][part2][part3] = data
is fetched by: $hash_config->{BIG_CLUSTER}{part1}{part2}{part3};
There are a couple of restrictions as for the names of the keys. First of all, all the characters should be alphabetic, numeric, underscores or hyphens, with square brackets allowed for the clustering. That is, the keys should conform to /^[A-Za-z0-9_-]+$/
This means also that no space is allowed in the key part of the line.
CLUSTER_ONE[data] = data cluster one # Right
CLUSTER_ONE[ data ] = data cluster one # Wrong
Download (0.004MB)
Added: 2007-04-12 License: Perl Artistic License Price:
928 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above file search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed