Re: Applying permissions to all files in all subfolders
Re: Applying permissions to all files in all subfolders
- Subject: Re: Applying permissions to all files in all subfolders
- From: "John C. Welch" <email@hidden>
- Date: Wed, 15 Aug 2007 15:19:55 -0500
- Thread-topic: Applying permissions to all files in all subfolders
On 8/15/07 14:37 PM, "Mark J. Reed" <email@hidden> wrote:
>> Folder action running do shell script. I've quite a few of these running.
>
> Right, but you still have to attach the folder action to each new subfolder.
Technically, you only attach it to the folder you're adding items to. That
can be, depending on how much work you wish to do, anywhere, really. As long
as you add the requisite items to the same place, the physical location of
the folder is rather unimportant, as long as the script can see everything
it needs to.
>
>> Not at all. Have the folder action go through the list of items and apply
>> the proper command based on item type.
>
> Yes, as my original script did.
>
> You can certainly use { do shell script "chmod" } rather than { tell
> application "Finder" to set privileges } in order to fix the
> permissions, but in terms of solving the overall problem, it doesn't
> buy you anything. Except perhaps intuitiveness to UNIX geeks. :)
It makes it less work to write and test. chmod is hardly l33t shell stuff.
It's not 233 lines of perl.
> I don't know offhand which solution would be more efficient, but either
> way you have to execute it on the right items, avoid executing it on
> the wrong items, and distinguish between folders and non-folders.
Obviously. However, in this case, a specific, explicit chmod reference is
likely to be less overhead than having the finder parse through things, and
it lets you use each tool to their best advantage. In a use like this
however, one is FAR better off spending the time to optimize item
identification code, since that's the critical bit. The other advantage
chmod has, is that if you ever need to operate in an ACL environment, chmod
can apply ACLs, whereas the Finder can barely read them.
--
"Cluster bombing from B-52s is very, very accurate. The bombs are guaranteed
to always hit the ground."
USAF Ammo Troop.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden