Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: SilvrDrgn on July 15, 2008, 04:23:32 PM

Title: Setting file comments and protection bits on specific file extensions in entire directory tree?
Post by: SilvrDrgn on July 15, 2008, 04:23:32 PM
I need to set or remove file comments (filenote command) and protection bits (protect command) on specific files in an entire directory tree structure.  For example, I want to remove file comments and the "E" protection bit from all *.jpg files in a certain directory and all of the subdirectories below it.  I have tried various command syntaxes, but have been unsuccessful so far.  How do I go about doing what I need easily?  TIA!
Title: Re: Setting file comments and protection bits on specific file extensions in entire directory tree?
Post by: arnljot on July 15, 2008, 04:25:25 PM
If you have Magellan on Classic amiga, then you can do it by using a filter.
Title: Re: Setting file comments and protection bits on specific file extensions in entire directory tree?
Post by: JKD on July 15, 2008, 04:27:41 PM
Look for the equivalent of the DOS 'for' command on AmiNET...
Title: Re: Setting file comments and protection bits on specific file extensions in entire directory tree?
Post by: adolescent on July 15, 2008, 04:29:18 PM
I don't have Amiga DOS in front of me, but does the ALL switch work?  Something like:

FILENOTE #?.JPG "" ALL
Title: Re: Setting file comments and protection bits on specific file extensions in entire directory tree?
Post by: LoadWB on July 15, 2008, 04:36:55 PM
If not, you can create a script using LIST and LFORMAT, then EXEC it.  There's a way to do it with pipe, like in Unix, though off the top of my head I cannot recall the syntax.  I believe it's something like

list #?.JPG LFORMAT "protect %s -e" | exec
I asked a question about pipes a while back and I believe Piru answered spot-on.
Title: Re: Setting file comments and protection bits on specific file extensions in entire directory tree?
Post by: Piru on July 15, 2008, 04:37:19 PM
Code: [Select]
.> list some:path all pat #?.jpg lformat "protect *"%s%s*" -e*Nfilenote *"%s%s*"" to t:script
.> execute t:script

Obviously you can use a pipe aswell, but this temp scriptfile method works without, too.
Title: Re: Setting file comments and protection bits on specific file extensions in entire directory tree?
Post by: SilvrDrgn on July 15, 2008, 05:38:06 PM
Will give all the suggestions a try.  Thanks!
Title: Re: Setting file comments and protection bits on specific file extensions in entire directory tree?
Post by: Piru on July 15, 2008, 05:39:32 PM
Well sure you can, but only mine does what you wanted :-)
Title: Re: Setting file comments and protection bits on specific file extensions in entire directory tree?
Post by: LoadWB on July 15, 2008, 05:52:48 PM
Quote

Piru wrote:
Well sure you can, but only mine does what you wanted :-)


:-P  It's true, though.  I missed part of the original question.  :bow: