file repair
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 249
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
X File Explorer 1.00
X File Explorer is a file manager for the X Window System. more>>
X File Explorer (Xfe) is an MS-Explorer like file manager for X. X File Explorer is based on the popular, but discontinued, X Win Commander, originally developed by Maxim Baranov.
Xfe aims to be the file manager of choice for all the Unix addicts!
Why another file manager when the excellent Konqueror or Nautilus exist on Linux systems? The answer is quite simple : these file managers are very good, features rich and look wonderful, but they are like a brontosaurus when you are a console addict and only want to copy some files or delete it. Another problem is that they require either the whole Gnome or KDE desktops to be installed on your system!
On the contrary, Xfe is small, very rapid and only requires the FOX library to be fully functional. It can be launched from the command line in a fraction of second, and can efficiently complete the set of command line tools.
Main features:
- Four different file manager styles (one panel, two panels, tree list and one panel, tree list and two panels)
- Integrated text viewer (X File View, xfv)
- Integrated RPM viewer / installer / uninstaller (X File Query, xfq)
- Status line
- File associations
- Auto save registry
- Right mouse click pop-up menu in tree list and file list
- Change file(s) attributes
- Mount/Unmount devices (for Linux only)
- Toolbar
- Bookmarks (up to 20)
- Color schemes (GNOME, KDE, Windows...)
- Drag and Drop ( ctrl -> copy, shift -> move, alt -> symlink )
- Create / Extract archives (tar, zip, gzip, bzip2, compress formats are supported)
- Tool tips for long file names
- Progress bars or dialogs for lengthy file operations
- Image preview as thumbnails
- Ability to enqueue multimedia files (open command)
Key bindings:
- Help - F1
- View - F3, return
- Edit - F4
- Copy - F5, ctrl-c
- Cut - ctrl-x
- Paste - ctrl-v
- Move - F6, ctrl-d
- Rename - ctrl-n
- Delete - F8, del, ctrl-del
- Symlink - ctrl-s
- New file - F2
- New folder - F7
- Properties - F9
- Tree and one panel - ctrl-F1
- Tree and two panels - ctrl-F2
- One panel - ctrl-F3
- Two panels - ctrl-F4
- Hidden files - ctrl-F5
- Hidden folders - ctrl-F6
- Execute - ctrl-e
- Go home - ctrl-h
- Go up - backspace
- Terminal - ctrl-t
- Console file manager - ctrl-k
- Refresh - ctrl-r
- Select all - ctrl-a
- Deselect all - ctrl-z
- Invert selection - ctrl-i
- Add bookmark - ctrl-b
- Mount (Linux only) - ctrl-m
- Unmount (Linux only) - ctrl-u
- Quit - ctrl-q
<<lessXfe aims to be the file manager of choice for all the Unix addicts!
Why another file manager when the excellent Konqueror or Nautilus exist on Linux systems? The answer is quite simple : these file managers are very good, features rich and look wonderful, but they are like a brontosaurus when you are a console addict and only want to copy some files or delete it. Another problem is that they require either the whole Gnome or KDE desktops to be installed on your system!
On the contrary, Xfe is small, very rapid and only requires the FOX library to be fully functional. It can be launched from the command line in a fraction of second, and can efficiently complete the set of command line tools.
Main features:
- Four different file manager styles (one panel, two panels, tree list and one panel, tree list and two panels)
- Integrated text viewer (X File View, xfv)
- Integrated RPM viewer / installer / uninstaller (X File Query, xfq)
- Status line
- File associations
- Auto save registry
- Right mouse click pop-up menu in tree list and file list
- Change file(s) attributes
- Mount/Unmount devices (for Linux only)
- Toolbar
- Bookmarks (up to 20)
- Color schemes (GNOME, KDE, Windows...)
- Drag and Drop ( ctrl -> copy, shift -> move, alt -> symlink )
- Create / Extract archives (tar, zip, gzip, bzip2, compress formats are supported)
- Tool tips for long file names
- Progress bars or dialogs for lengthy file operations
- Image preview as thumbnails
- Ability to enqueue multimedia files (open command)
Key bindings:
- Help - F1
- View - F3, return
- Edit - F4
- Copy - F5, ctrl-c
- Cut - ctrl-x
- Paste - ctrl-v
- Move - F6, ctrl-d
- Rename - ctrl-n
- Delete - F8, del, ctrl-del
- Symlink - ctrl-s
- New file - F2
- New folder - F7
- Properties - F9
- Tree and one panel - ctrl-F1
- Tree and two panels - ctrl-F2
- One panel - ctrl-F3
- Two panels - ctrl-F4
- Hidden files - ctrl-F5
- Hidden folders - ctrl-F6
- Execute - ctrl-e
- Go home - ctrl-h
- Go up - backspace
- Terminal - ctrl-t
- Console file manager - ctrl-k
- Refresh - ctrl-r
- Select all - ctrl-a
- Deselect all - ctrl-z
- Invert selection - ctrl-i
- Add bookmark - ctrl-b
- Mount (Linux only) - ctrl-m
- Unmount (Linux only) - ctrl-u
- Quit - ctrl-q
Download (1.6MB)
Added: 2007-07-17 License: GPL (GNU General Public License) Price:
839 downloads
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
queue_repair 0.9.0
queue_repair is a dynamic qmail queue checking and repair tool written in Python. more>>
queue_repair is a toolkit for dealing with the qmail queue directory structure; it can create a new queue, move and properly rename a queue, dynamically change the conf-split value, convert big-todo queues to non-big-todo and vice versa, and repair a corrupted queue.
<<less Download (0.014MB)
Added: 2005-04-29 License: GPL (GNU General Public License) Price:
1638 downloads
File::Revision 0.03
File::Revision is a Perl module to return a name of non-existing backup file with a revision id. more>>
File::Revision is a Perl module to return a name of non-existing backup file with a revision id.
SYNOPSIS
#######
# Subroutine interface
#
use File::Revision qw(new_revision num2revision parse_options revision2num revision_file rotate);
($file_name, $next_revsion) = new_revision($file, @options);
($file_name, $next_revsion) = new_revision($file, @options);
($file_name, $next_revsion) = new_revision($file, %options);
$revision_letter = num2revision($revision_number);
$options = parse_options($file, @options);
$options = parse_options($file, @options);
$options = parse_options($file, %options);
$revision_number = revision2num($revision_letter;
$file_name = revision_file($revision_number, $options);
$file_name = rotate($file, @options);
$file_name = rotate($file, @options);
$file_name = rotate($file, %options);
#######
# Object interface
#
$self = File::Revision; # or
$self = new $class; # where $class::@ISA contains File::Revision
($file_name, $next_revsion) = $self->new_revision($file, @options);
($file_name, $next_revsion) = $self->new_revision($file, @options);
($file_name, $next_revsion) = $self->new_revision($file, %options);
$revision_letter = $self->num2revision($revision_number);
$options = $self->parse_options($file, @options);
$options = $self->parse_options($file, @options);
$options = $self->parse_options($file, %options);
$revision_number = $self->revision2num($revision_letter;
$file_name = $self->revision_file($revision_number, $options);
$file_name = $self->rotate($file, @options);
$file_name = $self->rotate($file, @options);
$file_name = $self->rotate($file, %options);
The File::Revision program modules provides the name of a non-existing file with a revision identifier based on the a file name $file. This has many uses backup file uses. There are no restrictions on the number of backup files or the time to live of the backup files.
A typical use would be to create a backup file for If the revised file passes does not pass all validity checks, use the backup file to replace or repair the revised file. This minimizes loses import data when revising files.
Better yet, create a temporary file, using one of the temp file name program modules. Revise the temp file. Once it passes all valitity checks, rename the original file to the backup file and rename the temp file to the original file. This allows full use of the original file until a validated revison is ready to replace it.
The File::Revision program module also supports limiting the backup files and delete the oldest once File::Revision reaches the rotation limit.
<<lessSYNOPSIS
#######
# Subroutine interface
#
use File::Revision qw(new_revision num2revision parse_options revision2num revision_file rotate);
($file_name, $next_revsion) = new_revision($file, @options);
($file_name, $next_revsion) = new_revision($file, @options);
($file_name, $next_revsion) = new_revision($file, %options);
$revision_letter = num2revision($revision_number);
$options = parse_options($file, @options);
$options = parse_options($file, @options);
$options = parse_options($file, %options);
$revision_number = revision2num($revision_letter;
$file_name = revision_file($revision_number, $options);
$file_name = rotate($file, @options);
$file_name = rotate($file, @options);
$file_name = rotate($file, %options);
#######
# Object interface
#
$self = File::Revision; # or
$self = new $class; # where $class::@ISA contains File::Revision
($file_name, $next_revsion) = $self->new_revision($file, @options);
($file_name, $next_revsion) = $self->new_revision($file, @options);
($file_name, $next_revsion) = $self->new_revision($file, %options);
$revision_letter = $self->num2revision($revision_number);
$options = $self->parse_options($file, @options);
$options = $self->parse_options($file, @options);
$options = $self->parse_options($file, %options);
$revision_number = $self->revision2num($revision_letter;
$file_name = $self->revision_file($revision_number, $options);
$file_name = $self->rotate($file, @options);
$file_name = $self->rotate($file, @options);
$file_name = $self->rotate($file, %options);
The File::Revision program modules provides the name of a non-existing file with a revision identifier based on the a file name $file. This has many uses backup file uses. There are no restrictions on the number of backup files or the time to live of the backup files.
A typical use would be to create a backup file for If the revised file passes does not pass all validity checks, use the backup file to replace or repair the revised file. This minimizes loses import data when revising files.
Better yet, create a temporary file, using one of the temp file name program modules. Revise the temp file. Once it passes all valitity checks, rename the original file to the backup file and rename the temp file to the original file. This allows full use of the original file until a validated revison is ready to replace it.
The File::Revision program module also supports limiting the backup files and delete the oldest once File::Revision reaches the rotation limit.
Download (0.087MB)
Added: 2007-02-12 License: Perl Artistic License Price:
985 downloads
File::PathList 0.02
File::PathList is a Perl module that can find a file within a set of paths (like @INC or Java classpaths). more>>
File::PathList is a Perl module that can find a file within a set of paths (like @INC or Java classpaths).
SYNOPSIS
# Create a basic pathset
my $inc = File::PathList->new( @INC );
# Again, but with more explicit params
my $inc2 = File::PathList->new(
paths => @INC,
cache => 1,
);
# Get the full (localised) path for a unix-style relative path
my $file = "foo/bar/baz.txt";
my $path = $inc->find_file( $file );
if ( $path ) {
print "Found $file at $pathn";
} else {
print "Failed to find $filen";
}
Many systems that map generic relative paths to absolute paths do so with a set of base paths.
For example, perl itself when loading classes first turn a Class::Name into a path like Class/Name.pm, and thens looks through each element of @INC to find the actual file.
To aid in portability, all relative paths are provided as unix-style relative paths, and converted to the localised version in the process of looking up the path.
<<lessSYNOPSIS
# Create a basic pathset
my $inc = File::PathList->new( @INC );
# Again, but with more explicit params
my $inc2 = File::PathList->new(
paths => @INC,
cache => 1,
);
# Get the full (localised) path for a unix-style relative path
my $file = "foo/bar/baz.txt";
my $path = $inc->find_file( $file );
if ( $path ) {
print "Found $file at $pathn";
} else {
print "Failed to find $filen";
}
Many systems that map generic relative paths to absolute paths do so with a set of base paths.
For example, perl itself when loading classes first turn a Class::Name into a path like Class/Name.pm, and thens looks through each element of @INC to find the actual file.
To aid in portability, all relative paths are provided as unix-style relative paths, and converted to the localised version in the process of looking up the path.
Download (0.026MB)
Added: 2007-06-06 License: Perl Artistic License Price:
870 downloads
Playlist-repair 0.0-2
Playlist-repair scans music-playlists (M3U and PLS) for dead-links (moved or renamed files) and double entries. more>>
Playlist-repair scans music-playlists (PLS and M3U) for dead-links (moved or renamed files) and double entries.
The search-enginge finds moved and similar named files and replaces the wrong entrys in the playlist.
Enhancements:
- Missing: ID3Tag support
<<lessThe search-enginge finds moved and similar named files and replaces the wrong entrys in the playlist.
Enhancements:
- Missing: ID3Tag support
Download (0.032MB)
Added: 2006-03-20 License: GPL (GNU General Public License) Price:
1319 downloads
File::MMagic 1.27
File::MMagic is a Perl module to guess file type. more>>
File::MMagic is a Perl module to guess file type.
SYNOPSIS
use File::MMagic;
use FileHandle;
$mm = new File::MMagic; # use internal magic file
# $mm = File::MMagic->new(/etc/magic); # use external magic file
# $mm = File::MMagic->new(/usr/share/etc/magic); # if you use Debian
$res = $mm->checktype_filename("/somewhere/unknown/file");
$fh = new FileHandle "< /somewhere/unknown/file2";
$res = $mm->checktype_filehandle($fh);
$fh->read($data, 0x8564);
$res = $mm->checktype_contents($data);
<<lessSYNOPSIS
use File::MMagic;
use FileHandle;
$mm = new File::MMagic; # use internal magic file
# $mm = File::MMagic->new(/etc/magic); # use external magic file
# $mm = File::MMagic->new(/usr/share/etc/magic); # if you use Debian
$res = $mm->checktype_filename("/somewhere/unknown/file");
$fh = new FileHandle "< /somewhere/unknown/file2";
$res = $mm->checktype_filehandle($fh);
$fh->read($data, 0x8564);
$res = $mm->checktype_contents($data);
Download (0.021MB)
Added: 2007-01-11 License: Perl Artistic License Price:
1017 downloads
File::RdistByRsync 0.3
File::RdistByRsync is a Perl module that can read rdist distfiles, emulate using rsync. more>>
File::RdistByRsync is a Perl module that can read rdist distfiles, emulate using rsync.
SYNOPSIS
use File::RdistByRsync
@dist_blocks = parse_rdist($distfile, %options)
($args, $extras, @dist_blocks) = rdist(@ARGV);
rsync(@ARGV)
perl -MFile::RdistByRsync -e rsync(qw/rdist command flags/)
File::RdistByRsync parses and understands rdist distfiles and command lines.
It can share its understanding by returning what it got (parse_rdist() and rdist()) or it can attempt to emulate rdist using rsync.
Why?
Well, because rdist is so slow its unusable and rsync has such a limited interface that its unusable. Im sure a better specification language than rdists could be developed, but rdists language already exists so I used it to drive rsync.
<<lessSYNOPSIS
use File::RdistByRsync
@dist_blocks = parse_rdist($distfile, %options)
($args, $extras, @dist_blocks) = rdist(@ARGV);
rsync(@ARGV)
perl -MFile::RdistByRsync -e rsync(qw/rdist command flags/)
File::RdistByRsync parses and understands rdist distfiles and command lines.
It can share its understanding by returning what it got (parse_rdist() and rdist()) or it can attempt to emulate rdist using rsync.
Why?
Well, because rdist is so slow its unusable and rsync has such a limited interface that its unusable. Im sure a better specification language than rdists could be developed, but rdists language already exists so I used it to drive rsync.
Download (0.010MB)
Added: 2006-10-02 License: Perl Artistic License Price:
1117 downloads
File::SmartNL 0.05
File::SmartNL is a slurp text files no matter the New Line (NL) sequence. more>>
File::SmartNL is a slurp text files no matter the New Line (NL) sequence.
SYNOPSIS
#####
# Subroutine Interface
#
use File::SmartNL qw(config fin fout smartnl);
$old_value = config( $option );
$old_value = config( $option => $new_value);
(@all_options) = config( );
$data = smart_nl($data);
$data = fin( $file_name, @options );
$char_count = fout($file_name, $data, @options);
######
# Object Interface
#
use File::SmartNL;
$default_options = File::SmartNL->default(@options);
$old_value = $default_options->config( $option );
$old_value = $default_options->config( $option => $new_value);
(@all_options) = $default_options->config( );
$data = File::SmartNL->smart_nl($data);
$data = File::SmartNL->fin( $file_name, @options );
$char_count = File::SmartNL->fout($file_name, $data, @options);
Generally, if a subroutine will process a list of options, @options, that subroutine will also process an array reference, @options, [@options], or hash reference, %options, {@options}. If a subroutine will process an array reference, @options, [@options], that subroutine will also process a hash reference, %options, {@options}. See the description for a subroutine for details and exceptions.
Different operating systems have different sequences for new-lines. Historically when computers where first being born, one of the mainstays was the teletype. The teletype understood ASCII. The teletype was an automated typewriter that would perform a carriage return when it received an ASCII Carriage Return (CR), 15, character and a new line when it received a Line Feed (LF), 12 character.
After some time came Unix. Unix had a tty driver that had a raw mode that sent data unprocessed to a teletype and a cooked mode that performed all kinds of translations and manipulations. Unix stored data internally using a single NL character at the ends of lines. The tty driver in the cooked mode would translate the New Line (NL) character to a CR,LF sequence. When driving a teletype, the physicall action of performing a carriage return took some time. By always putting the CR before the LF, the teletype would actually still be performing a carriage return when it received the LF and started a line feed.
After some time came DOS. Since the tty driver is actually one of the largest peices of code for UNIX and DOS needed to run in very cramp space, the DOS designers decided, that instead of writing a tailored down tty driver, they would stored a CR,LF in the internal memory. Data internally would be either text data or binary data.
Needless to say, after many years and many operating systems about every conceivable method of storing new lines may be found amoung the various operating systems. This greatly complicates moving files from one operating system to another operating system.
The smart NL methods in this package are designed to take any combination of CR and NL and translate it into the special NL seqeunce used on the site operating system. Thus, by using these methods, the messy problem of moving files between operating systems is mostly hidden in these methods. By using the fin and fout methods, text files may be freely exchanged between operating systems without any other processing.
The one thing not hidden is that the methods need to know if the data is text data or binary data. Normally, the assume the data is text and are overriden by setting the binary option.
Perl 5.6 introduced a built-in smart nl functionality as an IO discipline :crlf. See Programming Perl by Larry Wall, Tom Christiansen and Jon Orwant, page 754, Chapter 29: Functions, open function. For Perl 5.6 or above, the :crlf IO discipline my be preferable over the smart_nl method of this program module.
<<lessSYNOPSIS
#####
# Subroutine Interface
#
use File::SmartNL qw(config fin fout smartnl);
$old_value = config( $option );
$old_value = config( $option => $new_value);
(@all_options) = config( );
$data = smart_nl($data);
$data = fin( $file_name, @options );
$char_count = fout($file_name, $data, @options);
######
# Object Interface
#
use File::SmartNL;
$default_options = File::SmartNL->default(@options);
$old_value = $default_options->config( $option );
$old_value = $default_options->config( $option => $new_value);
(@all_options) = $default_options->config( );
$data = File::SmartNL->smart_nl($data);
$data = File::SmartNL->fin( $file_name, @options );
$char_count = File::SmartNL->fout($file_name, $data, @options);
Generally, if a subroutine will process a list of options, @options, that subroutine will also process an array reference, @options, [@options], or hash reference, %options, {@options}. If a subroutine will process an array reference, @options, [@options], that subroutine will also process a hash reference, %options, {@options}. See the description for a subroutine for details and exceptions.
Different operating systems have different sequences for new-lines. Historically when computers where first being born, one of the mainstays was the teletype. The teletype understood ASCII. The teletype was an automated typewriter that would perform a carriage return when it received an ASCII Carriage Return (CR), 15, character and a new line when it received a Line Feed (LF), 12 character.
After some time came Unix. Unix had a tty driver that had a raw mode that sent data unprocessed to a teletype and a cooked mode that performed all kinds of translations and manipulations. Unix stored data internally using a single NL character at the ends of lines. The tty driver in the cooked mode would translate the New Line (NL) character to a CR,LF sequence. When driving a teletype, the physicall action of performing a carriage return took some time. By always putting the CR before the LF, the teletype would actually still be performing a carriage return when it received the LF and started a line feed.
After some time came DOS. Since the tty driver is actually one of the largest peices of code for UNIX and DOS needed to run in very cramp space, the DOS designers decided, that instead of writing a tailored down tty driver, they would stored a CR,LF in the internal memory. Data internally would be either text data or binary data.
Needless to say, after many years and many operating systems about every conceivable method of storing new lines may be found amoung the various operating systems. This greatly complicates moving files from one operating system to another operating system.
The smart NL methods in this package are designed to take any combination of CR and NL and translate it into the special NL seqeunce used on the site operating system. Thus, by using these methods, the messy problem of moving files between operating systems is mostly hidden in these methods. By using the fin and fout methods, text files may be freely exchanged between operating systems without any other processing.
The one thing not hidden is that the methods need to know if the data is text data or binary data. Normally, the assume the data is text and are overriden by setting the binary option.
Perl 5.6 introduced a built-in smart nl functionality as an IO discipline :crlf. See Programming Perl by Larry Wall, Tom Christiansen and Jon Orwant, page 754, Chapter 29: Functions, open function. For Perl 5.6 or above, the :crlf IO discipline my be preferable over the smart_nl method of this program module.
Download (0.082MB)
Added: 2007-02-09 License: Perl Artistic License Price:
987 downloads
File::LockDir 0.01
File::LockDir is a Perl basic filename-level lock utility. more>>
File::LockDir is a Perl basic filename-level lock utility.
SYNOPSIS
use File::LockDir;
INTERFACE
new
Initializes the class. Returns the singleton object.
nflock($file, $nap_till, $locker, $lockhost)
Locks the supplied filename. Only $file is required.
$file is the file to be locked; $nap_till is the total amount of time to wait before giving up; $locker is a name identifying the locker; $lockhost is the host requesting the lock.
nunflock($file)
Unlocks the supplied file.
nlock_state($file)
Checks the state of the lock for the supplied file. Returns a list: the first item is true if the file is unlocked, and false if not; the second item is undef if the file is unlocked, and the identity (name and host) is it is locked.
DIAGNOSTICS
%s already locked
Seen when youve already locked the requested pathname. Informational only.
No pathname to be locked
You didnt supply a pathname to be locked to nflock. Fatal.
cant write to directory of %s
The directory where the file resides cant be written, so the lockfile cant be created.
cant get %s: %s
The named lock cant be gotten: the reason is supplied. Failure occurs after ten tries to get the lock.
%s %s[%s]: lock on %s held by %s
The lock on the specified file is help by the noted locker. Informatory message, printed only when debugging is on.
close failed for %s: %s
The file containing the lock information couldnt be closed for the reason shown.
releasing lock on %s
Debug message; notes that the lock on the specified file was successfully released.
<<lessSYNOPSIS
use File::LockDir;
INTERFACE
new
Initializes the class. Returns the singleton object.
nflock($file, $nap_till, $locker, $lockhost)
Locks the supplied filename. Only $file is required.
$file is the file to be locked; $nap_till is the total amount of time to wait before giving up; $locker is a name identifying the locker; $lockhost is the host requesting the lock.
nunflock($file)
Unlocks the supplied file.
nlock_state($file)
Checks the state of the lock for the supplied file. Returns a list: the first item is true if the file is unlocked, and false if not; the second item is undef if the file is unlocked, and the identity (name and host) is it is locked.
DIAGNOSTICS
%s already locked
Seen when youve already locked the requested pathname. Informational only.
No pathname to be locked
You didnt supply a pathname to be locked to nflock. Fatal.
cant write to directory of %s
The directory where the file resides cant be written, so the lockfile cant be created.
cant get %s: %s
The named lock cant be gotten: the reason is supplied. Failure occurs after ten tries to get the lock.
%s %s[%s]: lock on %s held by %s
The lock on the specified file is help by the noted locker. Informatory message, printed only when debugging is on.
close failed for %s: %s
The file containing the lock information couldnt be closed for the reason shown.
releasing lock on %s
Debug message; notes that the lock on the specified file was successfully released.
Download (0.006MB)
Added: 2007-01-22 License: Perl Artistic License Price:
712 downloads
File::Wildcard 0.10
File::Wildcard is a Perl module for enhanced glob processing. more>>
File::Wildcard is a Perl module for enhanced glob processing.
SYNOPSIS
use File::Wildcard;
my $foo = File::Wildcard->new(path => "/home/me///core");
while (my $file = $foo->next) {
unlink $file;
}
When looking at how various operating systems do filename wildcard expansion (globbing), VMS has a nice syntax which allows expansion and searching of whole directory trees. It would be nice if other operating systems had something like this built in. The best Unix can manage is through the utility program find.
This module provides this facility to Perl. Whereas native VMS syntax uses the ellipsis "...", this will not fit in with POSIX filenames, as ... is a valid (though somewhat strange) filename. Instead, the construct "///" is used as this cannot syntactically be part of a filename, as you do not get three concurrent filename separators with nothing between (three slashes are used to avoid confusion with //node/path/name syntax).
You dont have to use this syntax, as you can do the splitting yourself and pass in an arrayref as your path.
The module also forms a regular expression for the whole of the wildcard string, and binds a series of back references ($1, $2 etc.) which are available to construct new filenames.
new
File::Wildcard-new( $wildcard, [,option => value,...]);>
my $foo = File::Wildcard->new( path => "/home/me///core");
my $srcfnd = File::Wildcard->new( path => "src///*.cpp",
match => qr(^src/(.*?).cpp$),
derive => [src/$1.o,src/$1.hpp]);
This is the constructor for File::Wildcard objects. At a simple level, pass a single wildcard string as a path.
For more complicated operations, you can supply your own match regexp, or use the derive option to specify regular expression captures to form the basis of other filenames that are constructed for you.
The $srcfnd example gives you object files and header files corresponding to C++ source files.
Here are the options that are available:
path
This is the input parameter that specifies the range of files that will be looked at. This is a glob spec which can also contain the ellipsis /// (it could contain more than one ellipsis, but the benefit of this is questionable, and multiple ellipsi would cause a performance hit).
Note that the path can be relative or absolute. new will do the right thing, working out that a path starting with / is absolute. In order to recurse from the current directory downwards, specify .///foo.
As an alternative, you can supply an arrayref with the path constituents already split. If you do this, you need to tell new if the path is absolute. Include an empty string for an ellipsis. For example:
foo///bar/*.c is equivalent to [foo,,bar,*.c]
You can also construct a File::Wildcard without a path. A call to next will return undef, but paths can be added using the append and prepend methods.
absolute
This is ignored unless you are using a pre split path. If you are passing a string as the path, new will work out whether the path is absolute or relative. Pass a true value for absolute paths.
If your original filespec started with / before you split it, specify absolute => 1. absolute is not required for Windows if the path contains a drive specification, e.g. C:/foo/bar.
case_insensitive
By default, the module will use Filesys::Type to determine whether the file system of your wildcard is defined. This is an optional module (see Module::Optional), and File::Wildcard will guess at case sensitivity based on your operating system. This will not always be correct, as the file system might be VFAT mounted on Linux or ODS-5 on VMS.
Specifying the option case_insensitive explicitly forces this behaviour on the wildcard.
Note that File::Wildcard will use the file system of the current working directory if the path is not absolute. If the path is absolute, you should specify the case_sensitivity option explicitly.
exclude
You can provide a regexp to apply to any generated paths, which will cause any matching paths not to be processed. If the root of a directory tree matches, no processing is done on the entire tree.
This option can be useful for excluding version control repositories, e.g.
exclude => qr/.svn/
match
Optional. If you do not specify a regexp, you get all the files that match the glob; in addition, new will set up a regexp for you, to provide a capture for each wildcard used in the path.
If you do provide a match parameter, this will be used instead, and will filter the results.
derive
Supply an arrayref with a list of derived filenames, which will be constructed for each matching file. This causes next to return an arrayref instead of a scalar.
follow
If given a true value indicates that symbolic links are to be followed. Otherwise, the symbolic link target itself is presented, but the ellipsis will not traverse the link.
This module detects a looping symlink that points to a directory higher up, and will only present the tree once.
ellipsis_order
This can take one of the following values: normal, breadth-first, inside-out. The default option is normal. This controls how File::Wildcard handles the ellipsis. The default is a normal depth first search, presenting the name of each containing directory before the contents.
The inside-out order presents the contents of directories first before the directory, which is useful when you want to remove files and directories (all O/S require directories to be empty before rmdir will work). See t/03_absolute.t as this uses inside-out order to tidy up after the test.
Breadth-first is rarely needed (but I do have an application for it). Here, the whole directory contents is presented before traversing any subdirectories.
Consider the following tree: a/ a/bar/ a/bar/drink a/foo/ a/foo/lish
breadth-first will give the following order: qw(a/ a/bar/ a/foo/ a/bar/drink a/foo/lish). normal gives the order in which the files are listed. inside-out gives the following: qw(a/bar/drink a/bar/ a/foo/lish a/foo/ a/).
sort
By default, globbing returns the list of files in the order in which they are returned by the dirhandle (internally). If you specify sort => 1, the files are sorted into ASCII sequence (case insensitively if we are operating that way). If you specify a CODEREF, this will be used as a comparison routine. Note that this takes its operands in @_, not in $a and $b.
debug and debug_output
You can enable a trace of the internal states of File::Wildcard by setting debug to a true value. Set debug_output to an open filehandle to get the trace in a file. If you are submitting bug reports for File::Wildcard, attaching debug trace files would be very useful.
debug_output defaults to STDERR.
match
my $foo_re = $foo->match;
$foo->match(bar/core);
This is a get and set method that gives access to the match regexp that the File::Wildcard object is using. It is possible to change the regex on the fly in the middle of a search (though I dont know why anyone would want to do this).
append
$foo->append(path => /home/me///*.tmp);
appends a path to an objects todo list. This will be globbed after the object has finished processing the existing wildcards.
prepend
$srcfnd->prepend(path => $include_file);
This is similar to append, but prepends the path to the todo list. In other words, the current wildcard operation is interrupted to serve the new path, then the previous wildcard operation is resumed when this is exhausted.
next
while (my $core = $foo->next) {
unlink $core;
}
my ($src,$obj,$hdr) = @{$srcfnd->next};
The next method is an iterator, which returns successive files. Returns matching files if there was no derive option passed to new. If there was a derive option, returns an arrayref containing the matching filespec and all derived filespecs. The derived filespecs do not have to exist.
Note that next maintains an internal cursor, which retains context and state information. Beware if the contents of directories are changing while you are iterating with next; you may get unpredictable results. If you are intending to change the contents of the directories you are scanning (with unlink or rename), you are better off deferring this operation until you have processed the whole tree. For the pending delete or rename operations, you could always use another File::Wildcard object - see the spike example below:
all
my @cores = $foo->all;
all returns an array of matching files, in the simple case. Returns an array of arrays if you are constructing new filenames, like the $srcfnd example.
Beware of the performance and memory implications of using all. The method will not return until it has read the entire directory tree. Use of the all method is not recommended for traversing large directory trees and whole file systems. Consider coding the traversal using the iterator next instead.
reset
reset causes the wildcard context to be set to re-read the first filename again. Note that this will cause directory contents to be re-read.
Note also that this will cause the path to revert to the original path specified to new. Any additional paths appended or prepended will be forgotten.
close
Release all directory handles associated with the File::Wildcard object. An object that has been closed will be garbage collected once it goes out of scope. Wildcards that have been exhausted are automatically closed, (i.e. all was used, or c< next > returned undef).
Subsequent calls to next will return undef. It is possible to call reset after close on the same File::Wildcard object, which will cause it to be reopened.
<<lessSYNOPSIS
use File::Wildcard;
my $foo = File::Wildcard->new(path => "/home/me///core");
while (my $file = $foo->next) {
unlink $file;
}
When looking at how various operating systems do filename wildcard expansion (globbing), VMS has a nice syntax which allows expansion and searching of whole directory trees. It would be nice if other operating systems had something like this built in. The best Unix can manage is through the utility program find.
This module provides this facility to Perl. Whereas native VMS syntax uses the ellipsis "...", this will not fit in with POSIX filenames, as ... is a valid (though somewhat strange) filename. Instead, the construct "///" is used as this cannot syntactically be part of a filename, as you do not get three concurrent filename separators with nothing between (three slashes are used to avoid confusion with //node/path/name syntax).
You dont have to use this syntax, as you can do the splitting yourself and pass in an arrayref as your path.
The module also forms a regular expression for the whole of the wildcard string, and binds a series of back references ($1, $2 etc.) which are available to construct new filenames.
new
File::Wildcard-new( $wildcard, [,option => value,...]);>
my $foo = File::Wildcard->new( path => "/home/me///core");
my $srcfnd = File::Wildcard->new( path => "src///*.cpp",
match => qr(^src/(.*?).cpp$),
derive => [src/$1.o,src/$1.hpp]);
This is the constructor for File::Wildcard objects. At a simple level, pass a single wildcard string as a path.
For more complicated operations, you can supply your own match regexp, or use the derive option to specify regular expression captures to form the basis of other filenames that are constructed for you.
The $srcfnd example gives you object files and header files corresponding to C++ source files.
Here are the options that are available:
path
This is the input parameter that specifies the range of files that will be looked at. This is a glob spec which can also contain the ellipsis /// (it could contain more than one ellipsis, but the benefit of this is questionable, and multiple ellipsi would cause a performance hit).
Note that the path can be relative or absolute. new will do the right thing, working out that a path starting with / is absolute. In order to recurse from the current directory downwards, specify .///foo.
As an alternative, you can supply an arrayref with the path constituents already split. If you do this, you need to tell new if the path is absolute. Include an empty string for an ellipsis. For example:
foo///bar/*.c is equivalent to [foo,,bar,*.c]
You can also construct a File::Wildcard without a path. A call to next will return undef, but paths can be added using the append and prepend methods.
absolute
This is ignored unless you are using a pre split path. If you are passing a string as the path, new will work out whether the path is absolute or relative. Pass a true value for absolute paths.
If your original filespec started with / before you split it, specify absolute => 1. absolute is not required for Windows if the path contains a drive specification, e.g. C:/foo/bar.
case_insensitive
By default, the module will use Filesys::Type to determine whether the file system of your wildcard is defined. This is an optional module (see Module::Optional), and File::Wildcard will guess at case sensitivity based on your operating system. This will not always be correct, as the file system might be VFAT mounted on Linux or ODS-5 on VMS.
Specifying the option case_insensitive explicitly forces this behaviour on the wildcard.
Note that File::Wildcard will use the file system of the current working directory if the path is not absolute. If the path is absolute, you should specify the case_sensitivity option explicitly.
exclude
You can provide a regexp to apply to any generated paths, which will cause any matching paths not to be processed. If the root of a directory tree matches, no processing is done on the entire tree.
This option can be useful for excluding version control repositories, e.g.
exclude => qr/.svn/
match
Optional. If you do not specify a regexp, you get all the files that match the glob; in addition, new will set up a regexp for you, to provide a capture for each wildcard used in the path.
If you do provide a match parameter, this will be used instead, and will filter the results.
derive
Supply an arrayref with a list of derived filenames, which will be constructed for each matching file. This causes next to return an arrayref instead of a scalar.
follow
If given a true value indicates that symbolic links are to be followed. Otherwise, the symbolic link target itself is presented, but the ellipsis will not traverse the link.
This module detects a looping symlink that points to a directory higher up, and will only present the tree once.
ellipsis_order
This can take one of the following values: normal, breadth-first, inside-out. The default option is normal. This controls how File::Wildcard handles the ellipsis. The default is a normal depth first search, presenting the name of each containing directory before the contents.
The inside-out order presents the contents of directories first before the directory, which is useful when you want to remove files and directories (all O/S require directories to be empty before rmdir will work). See t/03_absolute.t as this uses inside-out order to tidy up after the test.
Breadth-first is rarely needed (but I do have an application for it). Here, the whole directory contents is presented before traversing any subdirectories.
Consider the following tree: a/ a/bar/ a/bar/drink a/foo/ a/foo/lish
breadth-first will give the following order: qw(a/ a/bar/ a/foo/ a/bar/drink a/foo/lish). normal gives the order in which the files are listed. inside-out gives the following: qw(a/bar/drink a/bar/ a/foo/lish a/foo/ a/).
sort
By default, globbing returns the list of files in the order in which they are returned by the dirhandle (internally). If you specify sort => 1, the files are sorted into ASCII sequence (case insensitively if we are operating that way). If you specify a CODEREF, this will be used as a comparison routine. Note that this takes its operands in @_, not in $a and $b.
debug and debug_output
You can enable a trace of the internal states of File::Wildcard by setting debug to a true value. Set debug_output to an open filehandle to get the trace in a file. If you are submitting bug reports for File::Wildcard, attaching debug trace files would be very useful.
debug_output defaults to STDERR.
match
my $foo_re = $foo->match;
$foo->match(bar/core);
This is a get and set method that gives access to the match regexp that the File::Wildcard object is using. It is possible to change the regex on the fly in the middle of a search (though I dont know why anyone would want to do this).
append
$foo->append(path => /home/me///*.tmp);
appends a path to an objects todo list. This will be globbed after the object has finished processing the existing wildcards.
prepend
$srcfnd->prepend(path => $include_file);
This is similar to append, but prepends the path to the todo list. In other words, the current wildcard operation is interrupted to serve the new path, then the previous wildcard operation is resumed when this is exhausted.
next
while (my $core = $foo->next) {
unlink $core;
}
my ($src,$obj,$hdr) = @{$srcfnd->next};
The next method is an iterator, which returns successive files. Returns matching files if there was no derive option passed to new. If there was a derive option, returns an arrayref containing the matching filespec and all derived filespecs. The derived filespecs do not have to exist.
Note that next maintains an internal cursor, which retains context and state information. Beware if the contents of directories are changing while you are iterating with next; you may get unpredictable results. If you are intending to change the contents of the directories you are scanning (with unlink or rename), you are better off deferring this operation until you have processed the whole tree. For the pending delete or rename operations, you could always use another File::Wildcard object - see the spike example below:
all
my @cores = $foo->all;
all returns an array of matching files, in the simple case. Returns an array of arrays if you are constructing new filenames, like the $srcfnd example.
Beware of the performance and memory implications of using all. The method will not return until it has read the entire directory tree. Use of the all method is not recommended for traversing large directory trees and whole file systems. Consider coding the traversal using the iterator next instead.
reset
reset causes the wildcard context to be set to re-read the first filename again. Note that this will cause directory contents to be re-read.
Note also that this will cause the path to revert to the original path specified to new. Any additional paths appended or prepended will be forgotten.
close
Release all directory handles associated with the File::Wildcard object. An object that has been closed will be garbage collected once it goes out of scope. Wildcards that have been exhausted are automatically closed, (i.e. all was used, or c< next > returned undef).
Subsequent calls to next will return undef. It is possible to call reset after close on the same File::Wildcard object, which will cause it to be reopened.
Download (0.023MB)
Added: 2007-04-27 License: Perl Artistic License Price:
910 downloads
Privateer Remake 1.2
Privateer gives you the freedom to carve your own path in the Wing Commander universe. more>>
Privateer gives you the freedom to carve your own path in the Wing Commander universe. Opportunity abounds in the Gemini Sector.
Wedged between the unknown frontier and the Kilrathi Empire, Gemini is home to various competing factions with which you can choose to align yourself.
Upgrade your ship or trade it in to deal with the demands of a Privateer. Find your fortune by logging into the mission computer, or take your chances with seedy characters in bars.
Meet up with Sandoval in New Detroit, tilt back a glass with Demetria in a Munchen bar in the Tingerhoff System. Make your way as a trader, traitor, bounty hunter, or pirate. Only you can imagine what you might encounter beyond the frontier.
Enhancements:
- New Refinery, Mining Base, Kamekh, Drayman, and Orion art was added.
- The targetting system was redone and is now more like the original.
- Radar range was reduced and all ships now have 2D wireframe HUD images and damage is shown by quadrant.
- The ship dealer now also functions as he did in the original.
- The auto-light now turns off when you are close to your destination.
- When a ship that is communicating with you is destroyed, its message now gets cut off. Asteroids can now be destroyed and mined.
- The repair bot was fixed.
- Unknown ships are there for the Righteous Fire campaign.
<<lessWedged between the unknown frontier and the Kilrathi Empire, Gemini is home to various competing factions with which you can choose to align yourself.
Upgrade your ship or trade it in to deal with the demands of a Privateer. Find your fortune by logging into the mission computer, or take your chances with seedy characters in bars.
Meet up with Sandoval in New Detroit, tilt back a glass with Demetria in a Munchen bar in the Tingerhoff System. Make your way as a trader, traitor, bounty hunter, or pirate. Only you can imagine what you might encounter beyond the frontier.
Enhancements:
- New Refinery, Mining Base, Kamekh, Drayman, and Orion art was added.
- The targetting system was redone and is now more like the original.
- Radar range was reduced and all ships now have 2D wireframe HUD images and damage is shown by quadrant.
- The ship dealer now also functions as he did in the original.
- The auto-light now turns off when you are close to your destination.
- When a ship that is communicating with you is destroyed, its message now gets cut off. Asteroids can now be destroyed and mined.
- The repair bot was fixed.
- Unknown ships are there for the Righteous Fire campaign.
Download (190MB)
Added: 2005-07-18 License: GPL (GNU General Public License) Price:
1565 downloads
File::DirCompare 0.3
File::DirCompare is a Perl module to compare two directories using callbacks. more>>
File::DirCompare is a Perl module to compare two directories using callbacks.
SYNOPSIS
use File::DirCompare;
# Simple diff -r --brief replacement
use File::Basename;
File::DirCompare->compare($dir1, $dir2, sub {
my ($a, $b) = @_;
if (! $b) {
printf "Only in %s: %sn", dirname($a), basename($a);
} elsif (! $a) {
printf "Only in %s: %sn", dirname($b), basename($b);
} else {
print "Files $a and $b differn";
}
});
# Version-control like Deleted/Added/Modified listing
my (@listing, @modified); # use closure to collect results
File::DirCompare->compare(old_tree, new_tree), sub {
my ($a, $b) = @_;
if (! $b) {
push @listing, "D $a";
} elsif (! $a) {
push @listing, "A $b";
} else {
if (-f $a && -f $b) {
push @listing, "M $b";
push @modified, $b;
} else {
# One file, one directory - treat as delete + add
push @listing, "D $a";
push @listing, "A $b";
}
}
});
File::DirCompare is a perl module to compare two directories using a callback, invoked for all files that are different between the two directories, and for any files that exist only in one or other directory (unique files).
File::DirCompare has a single public compare() method, with the following signature:
File::DirCompare->compare($dir1, $dir2, $sub, $opts);
The first three arguments are required - $dir1 and $dir2 are paths to the two directories to be compared, and $sub is the subroutine reference called for all unique or different files. $opts is an optional hashref of options - see OPTIONS below.
The provided subroutine is called for all unique files, and for every pair of different files encountered, with the following signature:
$sub->($file1, $file2)
where $file1 and $file2 are the paths to the two files. For unique files i.e. where a file exists in only one directory, the subroutine is called with the other argument undef i.e. for:
$sub->($file1, undef)
$sub->(undef, $file2)
the first indicates $file1 exists only in the first directory given ($dir1), and the second indicates $file2 exists only in the second directory given ($dir2).
<<lessSYNOPSIS
use File::DirCompare;
# Simple diff -r --brief replacement
use File::Basename;
File::DirCompare->compare($dir1, $dir2, sub {
my ($a, $b) = @_;
if (! $b) {
printf "Only in %s: %sn", dirname($a), basename($a);
} elsif (! $a) {
printf "Only in %s: %sn", dirname($b), basename($b);
} else {
print "Files $a and $b differn";
}
});
# Version-control like Deleted/Added/Modified listing
my (@listing, @modified); # use closure to collect results
File::DirCompare->compare(old_tree, new_tree), sub {
my ($a, $b) = @_;
if (! $b) {
push @listing, "D $a";
} elsif (! $a) {
push @listing, "A $b";
} else {
if (-f $a && -f $b) {
push @listing, "M $b";
push @modified, $b;
} else {
# One file, one directory - treat as delete + add
push @listing, "D $a";
push @listing, "A $b";
}
}
});
File::DirCompare is a perl module to compare two directories using a callback, invoked for all files that are different between the two directories, and for any files that exist only in one or other directory (unique files).
File::DirCompare has a single public compare() method, with the following signature:
File::DirCompare->compare($dir1, $dir2, $sub, $opts);
The first three arguments are required - $dir1 and $dir2 are paths to the two directories to be compared, and $sub is the subroutine reference called for all unique or different files. $opts is an optional hashref of options - see OPTIONS below.
The provided subroutine is called for all unique files, and for every pair of different files encountered, with the following signature:
$sub->($file1, $file2)
where $file1 and $file2 are the paths to the two files. For unique files i.e. where a file exists in only one directory, the subroutine is called with the other argument undef i.e. for:
$sub->($file1, undef)
$sub->(undef, $file2)
the first indicates $file1 exists only in the first directory given ($dir1), and the second indicates $file2 exists only in the second directory given ($dir2).
Download (0.008MB)
Added: 2007-07-05 License: Perl Artistic License Price:
841 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
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 repair 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