[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Carl's USAVE delete routine
- Subject: Re: Carl's USAVE delete routine
- From: cld@xxxxxxxx (Carl Distefano)
- Date: Sun, 27 Mar 2005 16:57:13 -0500
Reply to note from Harry Binswanger Wed, 30 Mar
2005 16:03:52 -0500
> The new delete routine is a great success, thanks.
In testing it, I began to warm to the idea of a delete routine for
my own use. Like you, I want something that will handle
AutoFile|USAVE "date-stamped" filenames, which tend to proliferate
on my system -- but also any other kind of file as well. In short,
a generic batch-delete routine (with verification).
I think I've got it. I call it DTFS (Delete These FileS), because
it's an extension of Robert's very handy frame DTF (Delete This
File), which it calls as a child routine. DTF operates on a single
file (the file displayed in the current window or the filename under
the cursor in a directory listing). DTFS operates on multiple files
(a DIR-style filespec or the directory listing in the current
window).
This is simpler than the routine I did for you, Harry. No fancy-
shmancy date comparisons and cutoff dates, no SMARTDIR aka SDIR
abbreviated filespecs. Just a simple directory listing
corresponding to the (conventional) filespec supplied on the CMline,
oldest files first. Listing the oldest first eliminates the need
for date-testing. When you reach newer files that you don't want to
delete, just hit the Escape key! Try it, you may like it. It
offers a lot more flexibility than the other routine. For date-
stamped filenames you can do DTFS 05*.* or
DTFS 0503*.*, or DTFS 05031*.*, etc., etc. -- any
year, any month -- any day, hour or minute, for that matter -- as
narrow or broad a range as you want. And you can feed it any other
filespec as well. DTFS *.tmp, DTFS foo*.b?r...
whatever. I think this will be useful.
This is a U2 frame, not a standalone routine like the earlier one.
You have to DECODE it, DeFine it, and issue ADD2U2 to add
it to your U2 file. There's a usage summary at the top of the frame.
XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5DTFs}} "Delete These FileS" (with verification) [CLD rev.
3/26/05][cr|lf]{002};*;[cr|lf];*; Usage: DTFS [d:\path\file
spec][cr|lf];*; Cycles through matching files (earl
iest dates first)[cr|lf];*; or through DIRectory listing,{032}
if displayed in current window[cr|lf];*; Default filespec (n
o arg, no DIR displayed) = *.*[cr|lf];*; [cr|lf]{<}SX11,{
<}VA@50{>}{>}{<}IF{<}VA|50{>}<1{>}{<}SV50,*.*{>}{<}EI{>}{<}IF
"\"{238}{<}IS50{>}<0&":"{238}{<}IS50{>}<0{>}{<}SX50,{<}VA$PA{
>}+"\"+{<}IS50{>}{>}{<}EI{>}[JM_]2.GetPath[Q2_]{<}SV12,{>}{<}
IF0+{<}VA$WS{>}<2!{<}VA|11{>}>0{>}{<}SX11,{<}IS50{>}+"\"+{<}I
S51{>}{>}{<}SX13,0+{<}VA$WA{>}{>}{<}IF{<}PV13{>}<1{>}{<}PRNo{032}
window{>}{<}EX{>}{<}EI{>}{<}SU14,{<}SX15,{<}VA$PA{>}{>}{<}IF"
:"{238}{<}IS15{>}=={<}VA|15{>}-1{>}{<}SX15,{<}IS15{>}+"\"{>}{
<}EI{>}{<}SX15,"[BX_]"+{<}VA@15:1{>}+":[Q2_][BX_]cd "+{<}IS15
{>}+"[Q2_]"{>}{>}{<}GT14{>}{<}SX16,{<}IS15{>}{>}{<}SV15,{>};*
;[cr|lf]{<}SX12,{<}VA@50:1{>}{>}[BX_]{<}PV12{>}:[Q2_]{<}GT14{
>}{<}SV14,{>}[BX_]cd {<}PV50{>}\[Q2_]{<}SV50,{>};*;[cr|lf][BX
_]exist {<}PV11{>}[Q2_]{<}IF{<}ER{>}{>}{<}PRNo matching files
{>}{<}EX{>}{<}EI{>}[BX_]func #{<}PV13{>}[Q2_];*;[cr|lf]{<}SX1
3,{<}VA$SD{>}{>}{<}IF({<}IS13{>}+"{014}"){240}",{014}"{>}{<}S
X13,{<}IS13{>}+",H"{>}{<}EI{>}[BX_]dsort d[Q2_][BX_]dir {<}PV
51{>}[Q2_][BX_]dsort {<}PV13{>}[Q2_]{<}PV15{>}{<}PV16{>}[DO_]
[FF_]{<}EI{>}{<}SV50,{>}[TF_];*;[cr|lf]{<}LBa{>}{<}SX13,{<}VA
$DR{>}{>}{<}IF"___.__"{238}{<}IS13{>}<0{>}[JM_]2.dtf[Q2_]{<}I
F0+{<}VA$KC{>}<2{>}{<}LBb{>}{<}IF{<}VA|12{>}>0{>}[JM_]2.ab/nv
[Q2_]{<}EI{>}{<}PRDone{>}{<}EX{>}{<}EI{>}{<}IF0+{<}VA$KC{>}<>
21{>}[LD_]{<}EI{>}{<}GLa{>}{<}EI{>}{<}GLb{>}{002}[cr|lf][cr|l
f]
-nd
XPLeNCODE
--
Carl Distefano
cld@xxxxxxxx