Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Possible bug with symlinks on linux ?
Possible bug with symlinks on linux ? [message #35101] Wed, 11 January 2012 14:07 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
TheIde opens correctly symlinks on Linux; when saving them it overwrites the symlink with the saved file instead of working on the linked one.

So, if I have this scenario :

somedir/aFile.cxx

and in another folder
anotherdir/aFile.cxx    where aFile.cxx is a symlink to former one


upon saving, the 'anoherdir/aFile.cxx' link is replaced with a standard file 'aFile.cxx'. I guess it should instead update the original (linked) file.....

The correct solution would be to truncate the file to 0 length bytes and then overwrite it, instead of (what I think happens...) deleting it and then recreating.

Max

[Updated on: Wed, 11 January 2012 14:13]

Report message to a moderator

Re: Possible bug with symlinks on linux ? [message #35175 is a reply to message #35101] Thu, 19 January 2012 08:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mdelfede wrote on Wed, 11 January 2012 08:07

TheIde opens correctly symlinks on Linux; when saving them it overwrites the symlink with the saved file instead of working on the linked one.

So, if I have this scenario :

somedir/aFile.cxx

and in another folder
anotherdir/aFile.cxx    where aFile.cxx is a symlink to former one


upon saving, the 'anoherdir/aFile.cxx' link is replaced with a standard file 'aFile.cxx'. I guess it should instead update the original (linked) file.....

The correct solution would be to truncate the file to 0 length bytes and then overwrite it, instead of (what I think happens...) deleting it and then recreating.

Max



The problem is that if there is a crash (e.g. power shutdown), file gets lost.

theide now saves files in this way: First, it saves the file, adding ".$tmp" to the filename. Then, only if save is successful, deleted the file and renames saved file.

I guess that what we really need is to create symlink for ".$tmp"....

Mirek
Re: Possible bug with symlinks on linux ? [message #35178 is a reply to message #35175] Thu, 19 January 2012 17:31 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
mirek wrote on Thu, 19 January 2012 08:46


The problem is that if there is a crash (e.g. power shutdown), file gets lost.

theide now saves files in this way: First, it saves the file, adding ".$tmp" to the filename. Then, only if save is successful, deleted the file and renames saved file.

I guess that what we really need is to create symlink for ".$tmp"....

Mirek


True.... we should operate directly on linked file instead, but I've (yet) no idea on how to get it.
As the link is symbolic, is just an alias, so doing your mechanics on linked file would do the job without problems, the link will still point to the right file once renamed.

Max
Re: Possible bug with symlinks on linux ? [message #35179 is a reply to message #35178] Thu, 19 January 2012 18:19 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
The unix 'readlink' function should do the job.
Use 'man 2 readlink' to see the usage.

Max
Re: Possible bug with symlinks on linux ? [message #42073 is a reply to message #35179] Sun, 16 February 2014 14:51 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
TheIDE is now saving symlinked files (and also files not owned by user) by overwriting the original, which fixes the problem.

(Sorry that it took 2 years Wink

Mirek
Previous Topic: Bug: Searching finds the end of the line instead of in text
Next Topic: Bug when viewing log file
Goto Forum:
  


Current Time: Tue Apr 16 21:07:42 CEST 2024

Total time taken to generate the page: 0.01300 seconds