2

enter image description here

I have Nikon D80. I have protected the image 'DSC_7219.JPG' on the camera because I like it.

Is there any way to see which images were protected when I put the memory card into a laptop?

I've tried checking the permissions on the card - everything has the same permissions. :(

enter image description here

1

Memory cards are formatted with either the FAT32 filesystem (for SDHC cards, 32 GiB or smaller) or the exFAT filesystem (SDXC, greater than 32 GiB) (or FAT16 for original MMC & SD Cards, in which case... your camera is quite old).

FAT filesystems do not support permissions that UNIX and Linux filesystems use. But depending on the FAT filesystem driver for your OS, you might be able to view, and even change, the FAT attributes (no-change, hidden, etc.).


On Mac, you can see that a file's readonly / no-change / protected attribute is set in at least 2 ways:

  1. In the Finder, the file's icon will have a lock overlaid on it:

    enter image description here
    SBB_0453.NEF and SBB_0454.NEF are locked

  2. In Terminal, use the -O (capital letter 'O') option with the ls command to display the file flags:

     $ ls -lO
    -rwxrwxrwx  1 sbb  staff  -    48513365 Aug 16 17:54 SBB_0450.NEF
    -rwxrwxrwx  1 sbb  staff  -    43237177 Aug 16 17:54 SBB_0451.NEF
    -rwxrwxrwx  1 sbb  staff  -    45605328 Aug 16 17:54 SBB_0452.NEF
    -rwxrwxrwx  1 sbb  staff  uchg 48392237 Aug 16 17:55 SBB_0453.NEF
    -rwxrwxrwx  1 sbb  staff  uchg 43243159 Aug 16 17:55 SBB_0454.NEF
    -rwxrwxrwx  1 sbb  staff  -    45593076 Aug 16 17:55 SBB_0455.NEF
    -rwxrwxrwx  1 sbb  staff  -    48239925 Aug 16 17:55 SBB_0456.NEF
    

    Notice the uchg flag — that's the flag to mark the file as unchangeable in the FAT filesystem.


I have been unable to view the FAT file flags using my Ubuntu system. I have tried both FAT32 and exFAT-formatted memory cards (mounting the latter with exfat-fuse and exfat-utils installed) using the lsattr utility.

  • For FAT32 cards, I get the following:

    lsattr: Inappropriate ioctl for device While reading flags on ./SBB_0453.NEF
    lsattr: Inappropriate ioctl for device While reading flags on ./SBB_0454.NEF
    lsattr: Inappropriate ioctl for device While reading flags on ./SBB_0455.NEF
    lsattr: Inappropriate ioctl for device While reading flags on ./SBB_0456.NEF
    
  • For exFAT cards, I get the following:

    lsattr: Function not implemented While reading flags on ./SBB_0453.NEF
    lsattr: Function not implemented While reading flags on ./SBB_0454.NEF
    lsattr: Function not implemented While reading flags on ./SBB_0455.NEF
    lsattr: Function not implemented While reading flags on ./SBB_0456.NEF
    
  • -O did the job. Thank you. Helpfully the flag remains set when I backup the card. – user67208 Sep 24 '18 at 9:22
1

Yes. Protected files have their "write" permission removed. How this looks depends on your operating system.

On Linux, this looks like:

$ ls -lh *.JPG
-rw-r--r--. 1 mattdm mattdm 4.5M Sep 21 14:21 DSCN1300.JPG
-r--r--r--. 1 mattdm mattdm 4.5M Sep 21 14:21 DSCN1301.JPG

The second file is protected; the first isn't.

(Or maybe -rw-rw-rw- depending on how your memory card is mounted.)

Of course, depending on how you copy files from the card, this information may be lost.

  • On Mac, you can simply Get Info on the volume & check 'ignore ownership', idk how Win does it. tbh, it's not a feature I've ever used, but it's probably only properly effective whilst the card is still in the camera. – Tetsujin Sep 21 '18 at 19:31
  • @Tetsujin Interesting; ignoring ownership also ignores file permissions? – mattdm Sep 21 '18 at 19:52
  • (That is, in Linux, a -r--r--r-- file is not writable even by the owner, although the owner of the directory it is in can delete or overwrite it. – mattdm Sep 21 '18 at 19:52
  • 'Ignore ownership' on a Mac doesn't ignore permissions, it just treats everybody who accesses files in the volume as owner (essentially making group and other perms useless). Is "Ignore ownership on this volume" reversible? – scottbb Sep 21 '18 at 23:05
  • This gave me a lot of hope - but unfortunately didn't work for me on OSX. – user67208 Sep 22 '18 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy