in reply to Re^11: File::Find problems
in thread File::Find problems

Here is what I discovered. I'm using mac os x 10.4.11, and I right clicked on one of the files that wouldn't move, and I chose Get Info. That popped up a dialog box that displayed info about the file. In the General section, in addition to the file size, path, creation date, etc., there were two checkboxes that said: Stationery Pad(whatever that is) and Locked. Locked was checked. A random sampling of 5 files that were moved had the Locked checkbox unchecked. So I unchecked Locked in the dialog box for both files and reran the script. This time the script successfully moved the two files.

What the heck is Locked referring to? Why the heck would two files be Locked? The files are on an SD digital camera card.

Hmmm...I wonder if that has to do with tagging the files in the camera, so they can't be erased?

Replies are listed 'Best First'.
Re^13: File::Find problems
by ikegami (Patriarch) on Jan 15, 2010 at 23:49 UTC

    What the heck is Locked referring to?

    Sounds like some kind of read-only flag. You might be able to use chmod to remove it.

    I wonder if that has to do with tagging the files in the camera, so they can't be erased?

    The camera might protect the files by making them read-only at the file-system level. Efficient, simple, portable.

      What the heck is Locked referring to?

      Sounds like some kind of read-only flag. You might be able to use chmod to remove it.

      I thought about that, however in the Get Info window the permissions don't change when I check and uncheck the Locked checkbox. The only thing that happens is the name of the file gets grayed out in a textbox its in--preventing me from changing the file name.

      Also, iPhoto had no problem copying locked .JPG files from the sd card to my computer.

      I've got an idea. The docs for File::Copy move() says it copies then deletes. I noticed that iPhoto just copied--the files remain on the sd card after iphoto imports the files. So maybe that is why I got "operation not permitted"--it was the deleting that was prohibited.

      I am going to take some more pictures, protect a few of them from deletion using the camera, then try to copy() the files rather than move() them.

        If something is read-only, you can still read (copy) it.