|
#1
| |||
| |||
| Hi, I am trying to delete a files using remove(). But, the locked file fails in remove() . I am looking for the api/function to unlock a locked file. Does anyone knows how to unlock a locked file . Thanks |
|
#2
| ||||
| ||||
| If you click once on the file and go to the File menu and select 'Get Info', under the 'General' setting in the info window there is a little tick box which says 'Locked'. Make sure it is not ticked, then delete the file by moving it to the trash and emptying it. You could also delete is by holding down the Alt/Option key when emptying the trash.
__________________ Intel Core 2 Duo iMac 2.16GHz • ATI Radeon X1600 • 2.5Gb • 10.5.6 • Epson CX6500 • Canon PIXMA iP4200 • ADSL 1.25GHz eMac G4 17" • ATI Radeon 9200 • 768Mb • 10.4.11 • HP Deskjet 840 |
|
#3
| ||||
| ||||
| I think since this is posted in "Software Programming & Web Scripting" that the original poster is looking for a way to unlock a file via some programming API (as stated in the original post) -- not by directly manipulating the file with the Finder.
__________________ 2009 Mac mini 2.0GHz • 2010 MacBook Air 11" • 2010 MacBook Pro 13" • LED 24" Cinema Display PowerMac G4 MDD dual 1.25GHz • PowerMac G4 Yikes! • iPad 2 32GB • 2 x iPhone 4 16GB • iPod Touch 8GB • iPod nano 1GB • iPod shuffle 1GB • AirPort Extreme dual-band • AppleTV http://www.jeffhoppe.com |
|
#4
| ||||
| ||||
| Quote:
__________________ Intel Core 2 Duo iMac 2.16GHz • ATI Radeon X1600 • 2.5Gb • 10.5.6 • Epson CX6500 • Canon PIXMA iP4200 • ADSL 1.25GHz eMac G4 17" • ATI Radeon 9200 • 768Mb • 10.4.11 • HP Deskjet 840 |
|
#5
| ||||
| ||||
| I'm not sure how to do it in straight C, but you can do it via AppleScript like this: Code: tell application "Finder" set the locked of file "Mac HD:path:to:file" to false end tell Code: tell application "Finder" set the locked of file (posix file "/path/to/file") to false end tell Code: SetFile -l /path/to/file |
![]() |
| Bookmarks |
| Thread Tools | |
| |