file
File Splitter 1.3
Split large text/html files into smaller files. I find it much faster and more accurate than cut and paste. You embed commands in the big file telling it which pieces of it are to go where, then let Splitter do the work. It is much faster and more accurate than trying to select huge blocks of text in an editor. You dont accidentally lose or duplicate text. Keeping files small makes the site more responsive. more>>
File Splitter - Split large text/html files into smaller files. I find it
much faster and more accurate than cut and paste.
You embed commands in the big file telling it which pieces
of it are to go where, then let Splitter do the work. It is
much faster and more accurate than trying to select huge
blocks of text in an editor. You dont accidentally lose or
duplicate text. Keeping files small makes the site more
responsive.
In the following pretend that [...] are actually lessthan...greater than.
You embed multiple [split tags in the file to be split of
the form:
[split charlie.html]
...
stuff that will end up in the charlie.html file.
...
[/split]
The text between the [split xxx] and [/split] tags is split
off into that named file and the text is removed from the
original file along with the tags.
1. Filenames may be absolute or relative, with no quotes or spaces.
2. Tags may be nested, but they must balance (equal number
of [split xxx] and [/split]).
3. Tags are case-insensitive, i.e. may be lower or upper case.
4. Multiple [split xxx] tags may be directed to the same
file, where they will be appended.
5. If the files mentioned in the split tags already exist,
they will be overwritten.
6. Anything not inside [split xxx].. [/split] is retained in
the original file. Everything else is removed.
The file being split must be small enough to fit in RAM.
Java array addressing limits the file to 2GB, though other
considerations mean in practice the largest file you can
handle will be smaller still.
To install, Extract the zip download with Winzip, available from
http://www.winzip.com (or similar unzip utility) into any
directory you please, often C:\ -- ticking off the (user
folder names) option. To run as an application, type:
java -jar C:\com\mindprod\splitter\splitter.jar x.html
adjusting as necessary to account for where the jar file is.
Enhancements:
Version 1.3
allow you to specify encoding
System Requirements:<<less
File::Util 3.22
File::Util is an easy, versatile, portable file handling module. more>>
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
File::Xcopy 0.12
File::Xcopy can copy files after comparing them. more>>
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.
File::Tabular 0.70
File::Tabular can search and edit flat tabular files. more>>
SYNOPSIS
use File::Tabular;
my $f = new File::Tabular($filename);
my $row = $f->fetchrow;
print $row->{field1}, $row->{field2};
$row = $f->fetchrow(where => someWord);
$row = $f->fetchrow(where => field1 > 4 AND field2 >= "01.01.2001");
$row = $f->fetchrow(where => qr/somes+(complexs*)?(regex|regular expression)/i);
$f->rewind;
my $rows = $f->fetchall(where => someField =~ ^[abc]+);
print $_->{someField} foreach @$rows;
$f->rewind;
$rows = $f->fetchall(where => +field1:someWord -field2:otherWord,
orderBy => field3, field6:num, field5:-alpha);
$f->rewind;
my $hashRows = $f->fetchall(where => foo AND NOT bar,
key => someField);
print $hashRows->{someKey}{someOtherField};
# open for updates, and remember the updates in a journal file
$f = new File::Tabular("+>$journalFile"});
# updates at specific positions (line numbers)
$f->splices(4 => 2, undef, # delete 2 lines from position 4
7 => 1, {f1 => $v1, f2 => $v2, ...}, # replace line 7
9 => 0, { ...}, # insert 1 new line at position 9
22 => 0, [{...}, {...}, ...] # insert several lines at pos. 22
...
-1 => 0, [{...}, {...}, ...] # append at the end
);
# shorthand to add new data at the end
$f->append({f1 => $v1, f2 => $v2, ...});
# same thing, but use the "Hash::Type" associated to the file
$f->append($f->ht->new($v1, $v2, ...));
$f->clear; # removes all data (but keeps the header line)
# updates at specific keys, corresponding to @keyFields
$f->writeKeys({key1 => {f1 => $v1, f2 => $v2, ...}, # add or update
key2 => undef, # remove
...
}, @keyFields);
# replay the updates on a backup file
my $bck = new File::Tabular("+<<less
X File Explorer 1.00
X File Explorer is a file manager for the X Window System. more>>
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
Get File 1.2.2
Get File is a Firefox extension that can get a file from an URL. more>>
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/
File::DirCompare 0.3
File::DirCompare is a Perl module to compare two directories using callbacks. more>>
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).
File::Repl 1.20
File::Repl is a Perl module that provides file replication utilities. more>>
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.
App::Conf::File 0.965
App::Conf::File is a Perl module to load and access configuration data. more>>
SYNOPSIS
use App::Conf;
$config = App::Conf->new();
$config = App::Conf->new(configFile => $file);
print $config->dump(), "n"; # use Data::Dumper to spit out the Perl representation
# accessors
$property_value = $config->get($property_name);
$branch = $config->get_branch($branch_name); # get hashref of properties
# on-demand loading helper methods (private methods)
$config->overlay($config2); # merge the two config structures using overlay rules
$config->overlay($config1, $config2); # merge $config2 onto $config1
$config->graft($branch_name, $config2); # graft new config structure onto branch
# By convention, the configurations for each App-Context service will be located
# two levels under the hash ref as shown.
$config->{Conf} # config settings for all Conf services
$config->{Conf}{default} # config settings for the default Conf service
$config->{Security} # config settings for all Security services
$config->{Security}{default} # config settings for the default Security service
$config->{Template}{tt} # config settings for the Template service named "tt"
# The default driver (if "configClass" not supplied) reads in a Perl
# data structure from the file. Alternate drivers can read a Storable,
# unvalidated XML, DTD-validated XML, RDF-validated XML, or any other
# file format or data source anyone cares to write a driver for.
$conf = {
Standard => {
Log-Dispatch => {
logdir => /var/p5ee,
}
},
Authen => {
passwd => /etc/passwd,
seed => 303292,
},
};
# A comparable unvalidating XML file would look like this.
< conf>
< Standard>
< Log-Dispatch logdir="/var/p5ee"/>
< /Standard>
< Authen passwd="/etc/passwd" seed="303292"/>
< /conf>
# A comparable ini file (.ini) would look like this.
[Standard.Log-Dispatch]
logdir = /var/p5ee
[Authen]
passwd = /etc/passwd
seed = 303292
# A comparable Java properties-like file would look like this.
Standard.Log-Dispatch.logdir = /var/p5ee
Authen.passwd = /etc/passwd
Authen.seed = 303292
File::Comments 0.07
File::Comments is a Perl module that ecognizes file formats and extracts format-specific comments. more>>
SYNOPSIS
use File::Comments;
my $snoop = File::Comments->new();
# *----------------
# | program.c:
# | /* comment */
# | main () {}
# *----------------
my $comments = $snoop->comments("program.c");
# => [" comment "]
# *----------------
# | script.pl:
# | # comment
# | print "howdy!n"; # another comment
# *----------------
my $comments = $snoop->comments("script.pl");
# => [" comment", " another comment"]
# or strip comments from a file:
my $stripped = $snoop->stripped("script.pl");
# => "print "howdy!n";"
# or just guess a files type:
my $type = $snoop->guess_type("program.c");
# => "c"
File::Comments guesses the type of a given file, determines the format used for comments, extracts all comments, and returns them as a reference to an array of chunks. Alternatively, it strips all comments from a file.
Currently supported are Perl scripts, C/C++ programs, Java, makefiles, JavaScript, Python and PHP.
The plugin architecture used by File::Comments makes it easy to add new formats. To support a new format, a new plugin module has to be installed. No modifications to the File::Comments codebase are necessary, new plugins will be picked up automatically.
File::Comments can also be used to simply guess a files type. It it somewhat more flexible than File::MMagic and File::Type. File types in File::Comments are typically based on file name suffixes (*.c, *.pl, etc.). If no suffix is available, or a given suffix is ambiguous (e.g. if several plugins have registered a handler for the same suffix), then the files content is used to narrow down the possibilities and arrive at a decision.
WARNING: THIS MODULE IS UNDER DEVELOPMENT, QUALITY IS ALPHA. IF YOU FIND BUGS, OR WANT TO CONTRIBUTE PLUGINS, PLEASE SEND THEM MY WAY.
File::FindByRegex 1.2
File::FindByRegex is a Perl wrapper for File::Find. more>>
SYNOPSYS
use File::FindByRegex;
$find = File::FindByRegex->new( {
-srcdir => [C:tmpteradata-sql],
-tardir => C:tmpteradata-sqldoc,
-find => {no_chdir => 1},
-callbacks =>
{
qr/.p(l|m|od|t)$/oi, => &treat_pod,
qr/sql.+?.sql$/oi, => treat_pod,
qr/.html?$/oi, => &treat_html,
qr/.txt$/oi => &treat_txt,
qr/.(jpg|gif|png|bmp|tiff)$/ => sub { &treat_graphic(@_) }
},
-ignore =>
[
qr/eg.+.sql$/oi, # *.sql in directory eg
qr/java/oi, # All files in java directory.
],
-excepts =>
[
qr/java.*?.html?$/oi # dont ignore *.html in java/
]
});
sub File::FindByRegex::treat_pod
{
my $this = shift;
...
}
sub File::FindByRegex::treat_html
{
my $this = shift;
...
}
sub File::FindByRegex::treat_txt
{
my $this = shift;
...
}
sub File::FindByRegex::treat_graphic
{
my $this = shift;
...
}
$find->travel_tree;
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>>
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.
File 4.21
File attempts to classify files depending on their contents and prints a description if a match is found. more>>
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.
Nokia::File::NFB 0.01
Nokia::File::NFB is a Perl module to create, read and rrite Nokia nfb/nfc phone backup files. more>>
SYNOPSIS
use Nokia::File::NFB;
my $nfb = new Nokia::File::NFB;
## read in the file phone_backup.nfb.
$nfb->read(phone_backup.nfb);
## print out the phone model the backup file is of.
print "Phone model is ", $nfb->phone(), "n";
## change the phone model to PerlPhone.
$nfb->phone("PerlPhone");
## write out the file as new_phone_backup.nfb.
$nfb->write(new_phone_backup.nfb);
This is used to parse existing or create new files in Nokia NFB or NFC format. NFB is the format used by the Nokia PC Suite Backup and Restore software.
The most interesting part is probably the elements() method. This is used to return each internal file backed up in the NFB file as a Nokia::File::NFB::Element object. These are useful things such as photos, contacts and calendar files.
I dont actually know what the letters NFB or NFC actually stand for, but they are the suffixes used on the backup and copy file created by the Backup and Restore program.
File-center 0.3
File-center is a simple Web application to download and upload files. more>>
File-center uses the PATH_INFO to pass the name of the directory or of the file in the URL.