| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | ffind = del |
RZ> Small doubt: how can I delete a list of files created by
RZ> ffind?
RZ> Example:
RZ> ffind /b /t"blablabla" *.ext > deleta.lst
RZ> del ???
RZ> (??? = list of files in deleta.lst)
this is something i do all the time... basically, you just want to read the
files from the list, one line at a time... this should do what you want...
complete with FD style logging OB-)
watch the linewrap! there should be a >> %logname% at the end of
every ECHO line...
=== snip ===
{at}echo off
set lstname=deleta.lst
set logname=deleta.log
echo. >> %logname%
echo ---------- %_DOW %_date, FTSCHATCH Process >> %logname%
echo %_TIME% DELETION: Starting process... >> %logname%
if not exist %lstname% goto error1
set linecnt=%{at}lines[%lstname%]
if %linecnt% EQ -1 goto error2
iff %linecnt% EQ 0 then
echo %_TIME% DELETION: Attempting to delete 1 file. >> %logname%
else
echo %_TIME% DELETION: Attempting to delete %{at}inc[%linecnt%] files.
>> %logname%
endiff
set curline=0
:loop
set hfname=%{at}line[%lstname%,%curline%]
set curline=%{at}inc[%curline%]
iff exist %hfname% then
echo %_TIME% DELETION: Deleting %hfname% >> %logname%
else
echo ! %_TIME% DELETION: %hfname% not found! >> %logname%
endiff
set curline=%{at}inc[%curline%]
if %curline% LT %linecnt% goto loop
echo %_TIME% DELETION: Removing input file %lstname% >> %logname%
del /q %lstname%
goto end
:error1
echo ! %_TIME% DELETION: %lstame% not found! >> %logname%
goto end
:error2
echo ! %_TIME% DELETION: %lstame% is an empty file! >> %logname%
goto end
:end
echo %_TIME% DELETION: Process complete. >> %logname%
set lstname=
set logname=
set linecnt=
set curline=
set hfname=
=== snip ===
run it after your ffind command with the deleta.lst in the current
directory... the log file is also created in the current directory... if
you want screen output, its easy enough to duplicate the echo lines and
remove the ">> %logname%" from the end...
)\/(ark
* Origin: (1:3634/12)SEEN-BY: 633/267 270 @PATH: 3634/12 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.