Re: Odd Finder Behavior
Re: Odd Finder Behavior
- Subject: Re: Odd Finder Behavior
- From: Christopher Nebel <email@hidden>
- Date: Wed, 6 Dec 2006 11:28:06 -0800
On Dec 6, 2006, at 9:50 AM, Peter Waibel wrote:
Has anyone suggestion how to savely delete files (data and
resource
fork) on a mounted volume without using finder scripting?
You can use rm.
I do use rm on my own files
but I'm still hesitating to use rm in scripts that are used by
others.
The reason why I'm hesitating is that I do not understand what rm
really does.
That's not unreasonable, because the answer to that question
changed some in Tiger. These days, rm(1) deletes the file,
including any sort of extended meta-data it has, regardless of the
type of file system it's on. This used to not be the case -- file
systems that don't support extended meta-data such as resource
forks store the extended information as a sibling file [1], and
rm(1) would only delete the primary one.
Therefore: if you can assume Tiger, then don't worry about it, it's
all good. If not, then you probably don't have to worry about it,
because most people only use HFS+ disks, for which the problem
doesn't apply. (However, that depends some on who your customers
are.)
Great news! I didn't know that the behavior of rm is improved in
Tiger.
Thanks for the detailed answer, Chris.
But there is already the next question: Does the behavior of "mv"
and "cp" have improved as well?
Yes; the entire BSD layer got an update in this respect. Even things
like rsync(1) respect meta-data now.
Is it a good idea to use unix commands with "do script" for
operating on files
or can we expect to get improved native AppleScript commands in the
future?
For a variety of reasons, I can't comment on the future [1], but using
"do shell script" is a reasonable solution for many tasks -- it has at
least the virtue of working (with the pre-Tiger caveats above). That
said, there are other solutions that also work, and depending on
precisely what you're doing and how you're doing it, they may be
superior to "do shell script" (where "superior" usually means "faster"
and often "more readable", though the latter is subjective). You
might try using System Events' Disk-Folder-File suite for some tasks.
--Chris Nebel
AppleScript Engineering
[1] "It's hard to make predictions, especially about the future." --
Yogi Berra
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden