- CONFIGURATION AND ENVIRONMENT
- SEE ALSO
- BUGS AND LIMITATIONS
- COPYRIGHT AND LICENSE
- DISCLAIMER OF WARRANTY
MSDOS::Descript - Manage 4DOS style DESCRIPT.ION files
This document describes version 1.05 of MSDOS::Descript, released September 20, 2014.
use MSDOS::Descript; $d = new MSDOS::Descript; print $d->description('foo.txt'); $d->rename('foo.txt', 'bar.txt'); $d->description('baz.txt','This is Baz.txt'); $d->description('frotz.txt', ''); # Remove description for frotz.txt $d->update;
MSDOS::Descript provides access to 4DOS style DESCRIPT.ION files.
Remember that changes to the descriptions are not saved unless you call the
By default, MSDOS::Descript uses relative paths, so if you change the current directory between
update, you'll be writing to a different file. To avoid this, you can pass an absolute path to
$d = MSDOS::Descript->new([$filename])
Constructs a new
$filenamemay be a directory or a 4DOS DESCRIPT.ION format file. If it's a directory, looks for a DESCRIPT.ION file in that directory. If
$filenameis omitted, it defaults to the current directory.
Gets or sets the description of
$descis omitted, returns the description of
undefif it doesn't have one. Otherwise, sets the description of
$descand returns the old description. (If
$descis the null string or
undef, the description is deleted.)
Transfers the description of
$old(if any) to
$new. This does not actually rename the file on disk.
Load the descriptions from
$fileis omitted, then re-read the original description file. Since
newdoes this automatically, you shouldn't have to call
Add the descriptions from
$fileto the current descriptions.
Writes the descriptions to
$file, or the original description file if
$fileis omitted. Marks the descriptions as unchanged if writing to the original description file. If the current directory has changed since the descriptions were loaded, and the description file was specified by a relative path (which is the default), you will be writing to a different file.
Returns a true value if the descriptions have changed since being loaded from the file.
Saves the descriptions to the original file if any changes have been made. The same warning about the current directory applies (see
write). Equivalent to
$d->write if $d->changed.
Turns on automatic updates for
$autois true or omitted. Otherwise, turns automatic updates off.
When automatic updates are on, the descriptions are automatically saved when the object is destroyed. Beware of relative paths! If the current directory changes before the object is destroyed, you're going to be writing to a different file! I strongly suggest that you use absolute paths if you're going to use
MSDOS::Descript requires no configuration files or environment variables.
MSDOS::Descript requires the Tie::CPHash module (a case-insensitive hash).
It also uses MSDOS::Attrib to hide DESCRIPT.ION files after it changes them. If you don't have MSDOS::Attrib, it will still work, but any DESCRIPT.ION files changed by MSDOS::Descript will become visible.
JP Software (http://jpsoft.com), makers of 4DOS, 4NT, and Take Command. These alternate shells for DOS & Windows originated (and can still use) the DESCRIPT.ION file format.
Uses relative paths, so changing the current directory after loading a description file can cause problems.
If you call
rename($old, $new), and
$new already had a description but
$old did not,
$new's description is preserved (instead of being erased). I can't decide if this is a bug or a feature, so I'm leaving it alone for now. This behavior may change in the future.
Christopher J. Madsen
<perl AT cjmweb.net>
Please report any bugs or feature requests to
<bug-MSDOS-Descript AT rt.cpan.org> or through the web interface at http://rt.cpan.org/Public/Bug/Report.html?Queue=MSDOS-Descript.
You can follow or contribute to MSDOS-Descript's development at https://github.com/madsen/msdos-descript.
This software is copyright (c) 2014 by Christopher J. Madsen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.