In article <michelle-C2652A.19571517012008.TakeThisOut@news.west.cox.net>,
Michelle Steiner <michelle.TakeThisOut@michelle.org> wrote:
> In article <mlsiemon-EC7C73.18412917012008.TakeThisOut@nnrp-virt.nntp.sonic.net>,
> Michael Siemon <mlsiemon.TakeThisOut@sonic.net> wrote:
>
> > > The above script works unless the file is a bundle, in which case I
> > > get an alert saying that it is a directory. How can I modify the
> > > script to get it to remove either a file or a bundle?
> >
> > try "rm -fR" ?
>
> Thanks. I settled on this:
>
> set the File_to_remove to ¬
> (quoted form of POSIX path of (choose file))
> do shell script "rm -r " & File_to_remove
Note: With the -r switch, "rm", will attempt to prompt you asking if you
would like to override permissions for a given directory or file if that
item's permissions and/or ownership are restricted to your user account.
Since user interaction is not possible within the "do shell script"
command, if this happens, your script may block or generate an error.
If you add the -f switch, the potential for such a prompt is less, but
it can still happen if you attempt to delete something that has very
restrictive permissions and/or ownership. You may want to deliberately
change permissions and ownership of some test files to see the effects
on your script.
--
Note: Please send all responses to the relevant news group. If you
must contact me through e-mail, let me know when you send email to
this address so that your email doesn't get eaten by my SPAM filter.
JR
>> Stay informed about: I need some help