Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Starky on August 19, 2014, 09:09:23 am

Title: C::B breaking unix hardlinks
Post by: Starky 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

Title: Re: C::B breaking unix hardlinks
Post by: oBFusCATed 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.
Title: Re: C::B breaking unix hardlinks
Post by: Starky on August 20, 2014, 01:09:44 am
Ok, is it possible to stop this functionality?
Title: Re: C::B breaking unix hardlinks
Post by: theodleif on February 07, 2016, 01:21:34 pm
Yes, but AFAIK only on a crude way:

https://github.com/theodleif/codeblocks4arduino
Title: Re: C::B breaking unix hardlinks
Post by: oBFusCATed 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.