home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
d2fn103.zip
/
d2fn.doc
next >
Wrap
Text File
|
1997-04-13
|
3KB
|
82 lines
D 2 F N
Date 2 File Name
Copyright (c) 1997 by Warren Mann
MANUAL
This program reads the current date from the system and uses it to change the
name of a specified file(s). The format of the new name can be given on the
command line.
To run D2FN from the command prompt, enter:
D2FN file_name.ext
Where file_name is the name of the file to change. This will rename the file(s)
named file_name to yy-mm-dd.ext, where yy is 2 digits representing the current
year, mm is 2 digits representing the current mont, dd is 2 digits representing
the current day and .ext is the extension of file_name. This is the default
format for the date string used as the new file name.
To change the format of the date string, us the -F switch (-f works also):
D2FN -fd-m-y file_name
This will rename the file(s) named file_name to dd-mm-yy.ext, where dd, mm and
yy have the same representations as above. Any character allowed in an os/2
file name may be used in the -F option and will be used in the new file name,
verbatim. The following characters are interpreted specially by D2FN and will
be replaced by numeric values in the new file name:
d .... replaced with exactly 2 digits representing the current day
m .... replaced with exactly 2 digits representing the current month
y .... replaced with exactly 2 digits representing the current decade (94)
yy ... replaced with exactly 4 digits representing the current year (1994)
specifying an extension, for example ".extension", in the format specification
sets the new name-extension to ".extension", otherwise the new extension is the
same as the old extension. A period with nothing following it will set the new
extension to nothing: "mm-dd-yy." Note that "extension" means anything
following the first '.' in the filename, including all subsequent '.'.
The -F option affects only the files following it on the command line, so:
D2FN file_name1.ext1 -fd-m-y.bak file_name2.ext2
will result in file_name1.ext1 being renamed mm-dd-yy.ext1 and file_name2.ext2
being renamed dd-mm-yy.bak.
That pretty much wraps up the complexities of D2FN usage. This program may be
freely passed around and I do not ask for any sort of reimbursement.
Any questions, comments or suggestions are welcome:
Warren Mann
broken@sound.net
REVISION HISTORY
Version 1.00, 15.02.1997
initial release.
Version 1.02, 03.04.1997
os/2 port from pc-dos original.
Version 1.03, 12.04.1997
changed to use os/2 file i/o and custom integer to string conversion to knock
30k off executable size.
ENJOY!