home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rexxlb.zip
/
SAMPLES
/
ANOTE.CMD
next >
Wrap
OS/2 REXX Batch file
|
1993-01-08
|
2KB
|
45 lines
/*****************************************************************************/
/* */
/* ANOTE: annotate a disk file using extended attributes. This program calls */
/* a text editor in order to allow creation of notes that can be attached to */
/* a file. The information is stored in the extended attributes of the file. */
/* If annotations already exist, they are displayed in the editor. */
/* */
/* Requires Personal REXX or REXXLIB (dosenv, dosdir, dosdel functions). */
/* */
/* A text editor is also required. As coded, ANOTE uses KEDIT. Any other */
/* editor name could be substituted. */
/* */
/* Command format: ANOTE <filename> */
/* */
/*****************************************************************************/
temp = dosenv('temp')'\$anote.tmp'
parse arg fname .
if fname = '' then do
say 'Format is:'
say ' ANOTE filename'
exit
end
if dosdir(fname) = '' then do
say fname 'not found.'
exit 1
end
call dosdel temp
call sysgetea fname, 'anote', 'notes'
if notes \= '' then
call charout temp, notes
call charout temp
timestamp = dosdir(temp,'dt')
'@kedit' temp
if dosdir(temp) = '' then do
say 'Note not created.'
exit 2
end
parse value dosdir(temp, 'sdt') with size timestamp1
if timestamp1 = timestamp then
exit 0
notes = charin(temp, , size)
call charout temp
call sysputea fname, 'anote', notes