I have a hierarchy of folders that I'd like to delete. Normally I'd use "rm
-r". However, there folders contain at least one file that is locked. I'm
familiar with using chmod to change permissions. However a locked file on a
Mac, as I understand it, is a not a permission thing, but a Mac OS thing.
I've heard that their is an Apple-provided tool to unlock files (e.g. in
terminal). Anyone know what the tool is called? Or any other approach?
Thanks
Ken Williams - 15 Oct 2004 01:30 GMT
On Oct 14, 2004, at 6:02 PM, jtownsen wrote:
> I have a hierarchy of folders that I'd like to delete. Normally I'd
> use "rm -r". However, there folders contain at least one file that is
[quoted text clipped - 5 lines]
> in terminal). Anyone know what the tool is called? Or any other
> approach?
It's /Developer/Tools/SetFile. There's a man page at `man SetFile`.
-Ken
Sherm Pendley - 15 Oct 2004 01:48 GMT
On Oct 14, 2004, at 7:02 PM, jtownsen wrote:
> I've heard that their is an Apple-provided tool to unlock files (e.g.
> in terminal). Anyone know what the tool is called?
SetFile. Uppercase attributes enable certain options, and lowercase
disables them. Locking is, predictably enough, "L/l". For example, to
unlock foo.txt:
SetFile -al foo.txt
For details, see "man SetFile".
> Or any other approach?
It looks like there's a FSpRstFLock() function in Mac::Files - part of
the Mac::Carbon distribution on CPAN - but I haven't used that.
sherm--