Welcome, Guest. Please login or register.

Author Topic: How to Delete a files recursively w/ wildcards?  (Read 5218 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Mizar

  • Jr. Member
  • **
  • Join Date: Oct 2009
  • Posts: 76
    • Show all replies
Re: How to Delete a files recursively w/ wildcards?
« on: April 27, 2011, 04:57:40 AM »
Firstly, make sure you're either in the directory you want to delete all .infos recursively from (current directory), or add the path before your #?.info.  For example, the command "delete dh2:mods/#?.info all".  This will delete all .info files in every nested subdirectory within the "dh2:mods" directory.  If any of them have the "d" protection bit missing, they won't be deleted, and it will report so.  In this case, use "delete dh2:mods/#?.info all force".
Amiga Tech. A1200: Apollo 1230/40 MHz & 882/50 MHz, 32 MB fast RAM, WD 298 GB HD (320 SI GB), Sony 1760 KB floppy, Surf Squirrel SCSI-II & buffered  serial, Ricoh CDRW 6x4x24, USR 33.6 Kbps modem, MV1200 scan doubler, Compaq 17" SVGA, KS 3.1, OS3.9 BB1, Genesis 45.7, Miami 3.2b, AWeb 3.5.09 APL

C= A500: 68000, 512 KB chip, 512 KB fast, 880 KB floppy x 2, 1084S, KS 1.3, OS 1.3
 

Offline Mizar

  • Jr. Member
  • **
  • Join Date: Oct 2009
  • Posts: 76
    • Show all replies
Re: How to Delete a files recursively w/ wildcards?
« Reply #1 on: April 27, 2011, 06:54:29 AM »
Quote from: marcfrick2112;633846
Mizar, Thanks for trying, but.... That command works for the main DIR but doesn't recurse into sub-directories.. I thought it had something to do with an odd usage of the LIST command....

Help me Obi-wan Kenobi, you're my only hope,,'
:laughing:

*sigh*


Oh, you're right.  That command doesn't work very well.  Yes, you have to use LIST LFORMAT to create a short script.  This will work, try this:

list dh2:mods all sub .info lformat "delete %p%n" >ram:delinf

(where dh2:mods again is your directory where you want to delete the .info files.)

Then "execute ram:delinf".  Just look and make sure the full path in the script file (ram:delinf) is correct before you delete the wrong directory.
« Last Edit: April 27, 2011, 07:08:06 AM by Mizar »
Amiga Tech. A1200: Apollo 1230/40 MHz & 882/50 MHz, 32 MB fast RAM, WD 298 GB HD (320 SI GB), Sony 1760 KB floppy, Surf Squirrel SCSI-II & buffered  serial, Ricoh CDRW 6x4x24, USR 33.6 Kbps modem, MV1200 scan doubler, Compaq 17" SVGA, KS 3.1, OS3.9 BB1, Genesis 45.7, Miami 3.2b, AWeb 3.5.09 APL

C= A500: 68000, 512 KB chip, 512 KB fast, 880 KB floppy x 2, 1084S, KS 1.3, OS 1.3