Password locking a file

Discussion in 'Mac Basics and Help' started by james1758, Aug 1, 2014.

  1. james1758 macrumors regular

    james1758

    Joined:
    May 26, 2013
    Location:
    UK
    #1
    Hi all,

    Long story short I have a file on my mac that needs to be locked and never accidentally thrown away. I currently don't need it but may do in 6 months or 2 years... who knows!

    I discovered a few days ago that when trying to move a file from Apple's desktop pictures to the trash I needed to put in my password to do so. Also if I tried to move the file to another folder then the original would always stay where it was and a copy would simply end up in the other folder. Extrememly useful I thought!
    Screen Shot 2014-08-02 at 00.13.44.png

    However, I can't seem to find how to do that with my own files? If somebody knows how to lock one of my files like apple seem to have done with theirs it would be appreciated.

    Cheers,
    James :D
     
  2. Tumbleweed666 macrumors 68000

    Joined:
    Mar 20, 2009
    Location:
    Near London, UK.
    #2
    Some random thoughts
    Is this file backed up? Otherwise it may be academic if you look for it in two years and it hasn't survived a computer catastrophe that happened previously.
    The reason a copy is made is likely due to it moving from one disk to another rather than it being locked to a location.
    If you have a second user on the mac (and if you don't, create one) then give the file to that user. Or indeed move the file to their documents area and then go back to your normal user, that way you are never going to accidentally touch it with some wider command such as deleting a folder forgetting its in there.
     
  3. drnebulous macrumors regular

    drnebulous

    Joined:
    Apr 27, 2014
    Location:
    Salford, UK
  4. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #4
    You can use chflags Terminal command to set the file to system immutable, you will then get requested for password if you try to trash or overwrite the file.

    Code:
    sudo chflags simmutable /path/to/file
    And to turn it off

    Code:
    sudo chflags noschg /path/to/file
     

Share This Page