Menu

#423 pcmanfm.conf symlinks destroyed

1.3
open
None
5
2018-02-14
2014-05-07
No

I am running pcmanfm version 1.1.2 on Fedora 20. I like to keep my configuration files in a git repository so that I can easily keep all my machines in sync. I have a script which creates symlinks so this can be easily done. For example on my machines, $HOME/.config/pcmanfm/LXDE/pcmanfm.conf should be a symlink to $HOME/config/dotfiles/config/pcmanfm/LXDE/pcmanfm.conf. This way, any changes I make to config files are detected by git, and syncing my configuration is as simple as a git pull. Unfortunately, this doesn't always work with pcmanfm.conf, as updating it with some of the GUI tools seems to remove the symlink, create a new file, and write to that new file instead of simply opening the existing file and writing to the existing file. A simple example of this is changing the wallpaper using the desktop preferences, the entire pcmanfm.conf file is overwritten and my symlink is no longer present. I then have to copy the new file into my git repo and remember to rerun the setup script everywhere else. Admittedly, I have never even looked in the codebase for pcmanfm, but I cannot see why the deletion of the old file is needed when simply opening the file in write mode will do the right thing regardless of whether the file is an actual file or a symlink.

Discussion

  • Jeffrey Lund

    Jeffrey Lund - 2014-05-07

    I've looked a bit more and it seems that src/desktop.c line 402 is where the saving of the pcmanfm.conf file is done. The docs for g_file_set_contents say that if the file is a symlink, it will be replaced. Is there a similar call somewhere which does not exhibit this behavior?

     
  • Lonely Stranger

    Lonely Stranger - 2014-05-09
    • status: open --> closed-wont-fix
    • assigned_to: Lonely Stranger
     
  • Lonely Stranger

    Lonely Stranger - 2014-05-09

    You cannot do "safe replace" if you overwrite the same file - as soon you start to write it, its old contents will be lost forever. It's why the safe API g_file_set_contents() is used there. I'm sorry but your approach is impossible to do. I would suggest to change your script that it will create a hardlink for $HOME/.config/pcmanfm/LXDE/pcmanfm.conf into $HOME/config/dotfiles/config/pcmanfm/LXDE/pcmanfm.conf from time to time and then it can be used to do your sync.
    Thank you for understanding.

     
  • Anonymous

    Anonymous - 2018-02-12

    Status: closed-wont-fix

    Wow, really? Things like this is why the linux community gets a bad rep from time to time.

    If millions of other projects can honor a system used by so many other developers, then so can this one. It's been 4 years, and this issue has been left in the same sad state as the original person who created this thread discovered it in.

    It is one thing to acknowledge that you do not fully understand the problem or fix, or expressing any reasons you have against implementing said fix, or even calling others for help because you don't want to work on this specific issue. But saying that it just cannot be done, is another thing entirely. The linux community is built around learning and experimenting, and this kind of attitude just breaks that paradigm and makes things harder for other devs.

    No, this is not "impossible to do". If that is how this project works then it needs to be changed.

     
  • Lonely Stranger

    Lonely Stranger - 2018-02-12

    It's so weird... a comment after more than 3 years. If someone really wanted this, he/she could either propose a patch, or state it clearly long time ago. Of course, if that was really needed, it could be implemented, but in any case it's not what is expected thus is a feature request, not a bug.

     
  • Lonely Stranger

    Lonely Stranger - 2018-02-12

    Ticket moved from /p/pcmanfm/bugs/868/

     
  • Lonely Stranger

    Lonely Stranger - 2018-02-14
    • status: closed-wont-fix --> open
    • Group: 1.2 --> 1.3
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB