Author Topic: PM 4.6.6 Behavior with symbolic links  (Read 3244 times)

Offline humanclock

  • Newcomer
  • *
  • Posts: 11
    • View Profile
PM 4.6.6 Behavior with symbolic links
« on: April 15, 2011, 09:06:26 PM »
(using PM 4.6.6 on OSX Snow Leopard)

I noticed that when you delete a symbolic link to a photo, the symbolic link is retained but the original photo is deleted.  Is this the expected behavior?  It seems to go against the Unix/Finder notion of how symbolic links are handled.  When you delete a symbolic link via the command line or in the finder, the symbolic link is deleted but the original image is retained.

Further, when you do delete a symbolic link to an image, only the caption part remains in the contact sheet.

Reproduction steps:
1) Copy an image to a directory (eg. testimage.cr2)
2) From the terminal command line (in that directory) type "ln -s testimage.cr2 anotheralias.cr2"
3) Go back to PM, you will notice two thumbnails of the image.  Delete the "anotheralias.cr2" one.
4) Looking at that directory on the command line (or Finder), "testimage.cr2" is deleted but the (now broken) symbolic link "anotheralias.cr2" remains.

FWIW I had an symbolic link in a folder that pointed to a non-existent file, I attempted to view this file in Digital Photo Professional and it crashed the program (I filed a bug report already), so then I got curious as to how PM acted in the same situation/etc.

-Craig

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: PM 4.6.6 Behavior with symbolic links
« Reply #1 on: April 15, 2011, 09:39:21 PM »
Craig,

(using PM 4.6.6 on OSX Snow Leopard)

I noticed that when you delete a symbolic link to a photo, the symbolic link is retained but the original photo is deleted.  Is this the expected behavior?  It seems to go against the Unix/Finder notion of how symbolic links are handled.  When you delete a symbolic link via the command line or in the finder, the symbolic link is deleted but the original image is retained.

Further, when you do delete a symbolic link to an image, only the caption part remains in the contact sheet.

Reproduction steps:
1) Copy an image to a directory (eg. testimage.cr2)
2) From the terminal command line (in that directory) type "ln -s testimage.cr2 anotheralias.cr2"
3) Go back to PM, you will notice two thumbnails of the image.  Delete the "anotheralias.cr2" one.
4) Looking at that directory on the command line (or Finder), "testimage.cr2" is deleted but the (now broken) symbolic link "anotheralias.cr2" remains.

PM doesn't treat symbolic links any different than real files.  I suppose if it isn't going to do the right thing then it should ignore them and not show them in the Contact Sheet.  Do you have PM set to move files to the Trash when deleting or just deleting the file directly?

-Kirk

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: PM 4.6.6 Behavior with symbolic links
« Reply #2 on: April 16, 2011, 01:28:35 AM »
Hello Kirk, Craig,

I see exactly the same behaviour on my system (Mac 10.6.7, PM 4.6.7 latest beta). Which is weird because if PM where to treat symbolic links as any file, this should not happen; it should delete the symbolic link file, not the original.
(I have PM move deleted files to the trash, but this has no bearing on the problem; PM simply deletes the wrong file)

As a further note to this problem (I think I mentioned it before), PM does not support aliases at all either. A real pity as I would like to be able to have aliases/symbolic links to directories and files. This would allow me, for instance, to have my directories/files in one location on a drive, but also in another (a wish that may become less urgent when we the catalogue function is implemented).

Cheers,
    Hayo
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline humanclock

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Re: PM 4.6.6 Behavior with symbolic links
« Reply #3 on: April 16, 2011, 10:55:05 AM »
Yeah, as Hayo said...it deletes wrong item.  I noticed that too about lack of support for aliases.  I have a script which generates a bunch of symbolic links to a single directory based on various tags in my photos.  The contents of this directory keep changing and it saves me a ton of "click-click-click" time in various non-PM programs (such as DPP), otherwise I have to spend somewhere short of forever navigating through thousands of folders and pictures in those programs.

Ideally PM would treat symbolic links and aliases the same way OS X treats them, possibly including the text "alias" (or an icon like the Finder shows for symbolic links) on the thumbnail to indicate it is an alias.