[Geany-devel] Overwriting a link on save as
dimitar.zhekov at xxxxx
Wed Mar 2 17:43:28 UTC 2011
On Wed, 02 Mar 2011 00:57:01 +0100
Colomban Wendling <lists.ban at herbesfolles.org> wrote:
> A user (yecril71pl) on #geany reported that saving as a file with the
> name of a symbolic link correctly ask for replacing but will try to
> modify the file at the location pointed by the link rather than
> replacing the link by a new file. This is IMHO at least not expected,
Why should it be unexpected?..
$ echo boza1 > boza1
$ ln -s boza1 boza2
$ echo boza2 > boza2
$ cat boza1
> and may be problematic if e.g. the target of that link isn't writable,
> since the write will fail (if using unsafe file saving).
chmod -w boza1
Geany File -> Save as -> boza2
"Error opening file '/home/build/boza2': Permission denied
The file on disk may now be truncated!"
> I then suggest to delete the file on "save as" if we see it's a symbolic
> link, so we will create a fresh new file with the proper name.
> Any thoughts?
Just what's the purpose of a link, be it soft or hard, if it does not
behave as a link?.. There is no such category as "link on read, but
non-link on write". If somebody wants to unlink a file, (s)he can do
that with any shell or file manager.
I tried ne, mousepad and scite, and none of them removes symlinks on
Save As. It may be different for gedit, of course.
More information about the Devel