Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Silly Terminal Question: Syntax/command to Lock a file?
#2
For starters, you could change the mode to disallow writing

sudo /bin/chmod a-w /Users/{student}/Library/Preferences/com.apple.dock.plist

Since the default permissions are 0600 (user gets r/w, group gets nothing, others get nothing}. The 'a-w' takes away write permission for everybody--user, group, others. The resulting permissions value is 0400 (owner gets only to read, noone else gets anything).

Before:
ls -l /Users/{student}/Library/Preferences/com.apple.dock.plist
-rw------- 1 {student} {group} 9287 Feb 23 08:53 /Users/{student}/Library/Preferences/com.apple.dock.plist

After:
ls -l /Users/{student}/Library/Preferences/com.apple.dock.plist
-r-------- 1 {student} {group} 9287 Feb 23 08:53 /Users/{student}/Library/Preferences/com.apple.dock.plist

If I can dredge up the Finder equivalent for locking, I'll post it later...

HTH,
[edit: chmod is in /bin not /usr/bin ]
Reply


Messages In This Thread
Re: Silly Terminal Question: Syntax/command to Lock a file? - by TheCaber - 02-26-2007, 05:44 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)