broken symbolic link

can someone offer a suggestion:

it seems when i create a symbolic link on the desktop and when i go to save the file - the link gets broken - this has been happening for over a month and i thought with updates the issue would be solved but it has not.

is it me?

any suggestions would be appreciated.

It is probably the editor (or other software) that you are using that causes the problem.

Maybe a bit more information would help. What are you trying to do? What actual commands are you using?

i am using libre office to edit 2 files and when i save - the links are broken.

thank you for reply.

gilles s.

Okay.

I almost never use Libre Office. I use it when somebody sends me a file from MSOFFICE. But it is never my choice.

Here are the different ways that various editors work:

(method 1) Make a temporary backup copy of the file. Load from the original file. Write the changed data back to the original file. Delete the temporary backup copy.

(method 2) Load from the original file. But rename the original to something different (often “filename.bak” or “filename.old”. Save the changed data back to the original file name.

(method 3) Load from original file. Save the changed data back to a completely different file name (often a randomized name). Rename that saved file back to the original file name (which deletes the original file name).

Of those, only method 1 will keep the symbolic link intact. The others will mess up your symbolic link.

There’s not much you can do about it, other than be aware of how your tools work. You could copy the file to a different name before editing, and then copy it back afterwards. That would preserve the symlink.

i am not too sure i understand - i believe i use the first approach (method)

however, it is when i write the file, the edited file, then the link breaks which is only recent with libreoffice - the file i am talking about is the linked file which shows on the desktop as a linked file but gets broken when written too.

thank you though for your effort, if i have to live with it i will but something is amuck in cyber space with this.

It is the editor not you that decides how the file is written and backed up. LO appears broken in this respect. try a different editor. Maybe make a request to the LO developers

It is not a matter of what you use. It is a matter of what the software does.

however, it is when i write the file, the edited file, then the link breaks which is only recent with libreoffice - the file i am talking about is the linked file which shows on the desktop as a linked file but gets broken when written too.

If this is a recent change to Libre Office, then you might consider filing a bug report, though it probably needs to be filed upstream with the Libre Office developers.

well, a simple test confirms the behavior on tumbleweed

  1. open LO writer, save file to ~/testo.odt
  2. cd Desktop && ln -s ~/testo.odt .
  3. now double click the symlink on the desktop, LO will open, edit and save the file in LO
  4. LO replaces the symlink with an actual odt file

that looks like a bug to me