PARM filename="?"
if "!filename" = "?"
echo Function: Purge a large file quickly
echo Syntax : PURGEQ filename
echo Parm : filename - the name of the file to be purged
echo Example : PURGEQ BIGFILE
echo
return
endif
FILE X = !filename, OLD; ACC=IN
if finfo( "*X", "exists" )
PURGE *X
else
PURGE !filename
endif
RESET X
The ",OLD" designation is used on the :FILE equation so that "finfo" will not acknowledge a temporary file of the same name. The "ACC=IN" is what removes write access.
If the file does not exist, we want :PURGE to return the appropriate error message without reference to file "X".
No doubt other enhancements are possible, but this gets the idea across.
Incidentally, temporary files are not affected by the "long purge."
--GlennCole?
-- ChrisBartram - 09 Jun 2006
| Topic Hp3000PurgeLargeFile . { Edit | Attach | Backlinks: Web All webs | Printable | History: r2 < r1 More } |
|
Ideas, requests, problems regarding TWiki? Send feedback Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.Hp3000PurgeLargeFile |