Author Topic: C::B breaking unix hardlinks  (Read 3658 times)

Offline Starky

  • Single posting newcomer
  • *
  • Posts: 2
C::B breaking unix hardlinks
« on: August 19, 2014, 09:09:23 am »
Hi all, I'm fairly new to C::B and probably just haven't found the way to configure it correctly. Let's see if I can explain this.

So I'm working on a file that has 6 hardlinks. However in C::B when I modify it and save, it changes the file's ownership to me, and breaks the link to the file I was working on. The remaining linked files now show 5 links excluding the one I just saved.

Is there a setting for this or something? Is it some sort of atomic save or something where it deletes the old file and saves the one in the editor as a new one with the old file name - thus killing the link? The file lives on a linux server.


Thanks

Starky

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B breaking unix hardlinks
« Reply #1 on: August 19, 2014, 09:32:08 am »
Yes, C::B first saves to a temp file and then renames the file to  the target filename.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Starky

  • Single posting newcomer
  • *
  • Posts: 2
Re: C::B breaking unix hardlinks
« Reply #2 on: August 20, 2014, 01:09:44 am »
Ok, is it possible to stop this functionality?
Starky

theodleif

  • Guest
Re: C::B breaking unix hardlinks
« Reply #3 on: February 07, 2016, 01:21:34 pm »
Yes, but AFAIK only on a crude way:

https://github.com/theodleif/codeblocks4arduino

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B breaking unix hardlinks
« Reply #4 on: February 07, 2016, 02:46:23 pm »
The proper way is to detect that the file is a link and then disable the temp+move mechanism we're using.

This is the ticket: https://sourceforge.net/p/codeblocks/tickets/276/
Patches welcome.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]