This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 7 - Pages: 1 - Last Post: 28-Nov-2018 19:51 Last Post By: jGromit Threads: [ Previous | Next ]
jGromit

Posts: 8,628
Registered: 31-Jan-2006
Issue with hard links
Posted: 28-Nov-2018 04:21
 
  Click to reply to this thread Reply
I see that hard links are applied to resource files in the album, as well as original images. This strikes me as being very dangerous. Imagine that you've installed a new version of a skin, and one of the resource files has been materially altered, but still has the same name. That resource file is then "magically" copied to all the existing albums that use that resource. But since the albums haven't been rebuilt with the new skin version, there could now be a serious, or even fatal, mismatch between the album page coding and the resource file in question. This is a prescription for trouble.

Perhaps this doesn't occur when one performs a true "install" of a new skin version, since that deletes the existing skin and replaces it. But if you manually replace files in the skin's resource directory, it certainly does happen.
jGromit

Posts: 8,628
Registered: 31-Jan-2006
Re: Issue with hard links
Posted: 28-Nov-2018 04:40   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Even more alarming, with hard links chosen, you can build an album, and if you edit one of the resource files in the finished album, that will change that resource file in the skin directory and in all other albums built with the same skin! This could have all sorts of unanticipated consequences.

ETA: I have tested this, and what I've described is exactly what happens. Editing a resource file in the output of one album changes all of the other instances of that resource file, even the one in the original skin directory. Wow.

ETAETA: This happens only in Win10. No problem in macOS.
RobM

Posts: 3,351
Registered: 4-Aug-2006
Re: Issue with hard links
Posted: 28-Nov-2018 10:11   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
On the plus side the feature has been available for a year now. Perhaps though the lack of any problem being reported is in part due to hard links being disabled by default.

Both when released, and in the manual, there is a warning about the potential for data loss when using hard links, though it only references the warning to using older versions of jAlbum on albums made with hard links enabled.

Does it need a one time warning pop up when enabling hard links?
jGromit

Posts: 8,628
Registered: 31-Jan-2006
Re: Issue with hard links
Posted: 28-Nov-2018 12:29   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
In my experiments, this is a fairly rare case. It doesn't afflict original images, probably because when you're in a photo editor and make changes to an image, the editor deletes the original and replaces it. That deletion breaks the hard link to the copy that's sitting in an album somewhere, so no damage is done. But if you've also chosen Link to originals, all sorts of exciting things start happening.

At a minimum, however, I would say that hard links should never be used for res files, because of the possibility of altering the skin files. The space savings are trivial, and don't warrant the risk.
davidekholm

Posts: 3,859
Registered: 18-Oct-2002
Re: Issue with hard links
Posted: 28-Nov-2018 18:03   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
What editor is it that rewrites the same file. The ones I've seen creates new files with the same name.
A skin can put a good amount of small res files in the target res folder, given that even small files can occupy far more data due to disk block sizes, I don't think the space saving is neglectable.
jGromit

Posts: 8,628
Registered: 31-Jan-2006
Re: Issue with hard links
Posted: 28-Nov-2018 18:35   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
What editor is it that rewrites the same file.

I've seen the same effect in Windows with Notepad, the default editor, and with Notetab Light, my own favorite.

The test is pretty simple. Stash dummy.txt, containing just "This is the original," in the res directory of Minimal. Make an album, and edit dummy.txt in the album's res directory. Now go back to the skin version, and see what's in it.

What alerted me to this was even more surprising. I replaced some skin res files in File Explorer, and those new files magically started appearing in existing albums (I noticed that my backup program was suddenly finding "new" files where there shouldn't have been any).
davidekholm

Posts: 3,859
Registered: 18-Oct-2002
Re: Issue with hard links
Posted: 28-Nov-2018 19:36   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
The question is just if this downside offsets the advantage of both saving disk space (remember disk blocks) and album build time... No other user has reported this as a problem and this feature has been available for over a year, right?
jGromit

Posts: 8,628
Registered: 31-Jan-2006
Re: Issue with hard links
Posted: 28-Nov-2018 19:51   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
The question is just if this downside offsets the advantage of both saving disk space (remember disk blocks) and album build time...

Disk space is cheap. Really cheap.

For that handful of res files, it's hard to believe that build time would change by a noticeable amount, even in a "res-heavy" skin, especially since they're not repeated in each project folder - only one set, at the top.

No other user has reported this as a problem and this feature has been available for over a year, right?

I have seen no reports, but the option is turned off by default, and I suspect very few users would have turned it on. Most would have trouble understanding what it is. I'm not even sure how it got turned on in my preferences - I had to do a little digging to refresh my memory about what it's supposed to do!
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums