Gedit: issue saving a shared file

Solved
commentcamarcheeay Posted messages 735 Status Member -  
commentcamarcheeay Posted messages 735 Status Member -
Hello,

I installed Debian on the virtual machine VirtualBox and shared a folder from my host system (Windows 7).

When I open files with gedit, I can’t save them. It shows me the following error: "Error renaming the temporary file: Text file busy". This error concerns pre-existing files. However, I can create my own files, still in the mounted folder, but I can't modify them again.

This issue seems to only affect gedit. The files are editable with vim, for example. All commands for copying (cp) and moving (rm) work perfectly. So, it’s not a permission issue. Moreover, the folder is correctly mounted under my username and I have full rights.

Here is the command line I use to mount my folder (which I add to the "/etc/rc.local" file):
mount -t vboxsf -o uid=1000,gid=1000,umask=0 maVmSource ~/monDossierLinux/

It’s also not the infamous gedit issue of not saving by default to an FTP folder. I’ve checked in gconf-editor > apps > gedit2 > ... > save for the presence of ftp.

I’ve visited many sites without finding a solution.

I do have one observation. I don’t know what happened, but there’s one folder for which I don’t have write permissions "w" but where I can save my files. It’s the only one that stands out. For the other folders, I have all the permissions, but saving doesn’t work.
There’s also a command that doesn't work; the famous chmod. Its use doesn’t raise an error, but it has no effect on my shared folders, even when used as root.

Thank you for your help!

Configuration: Linux / Mozilla 1.9.1.16

C. Taha

5 answers

  1. synopsis8 Posted messages 1478 Status Member 243
     
    Maybe GEDIT creates a swap file for each open file and doesn't delete it when you close it, and the next time, the swap file prevents you from modifying the file.
    1
    1. commentcamarcheeay Posted messages 735 Status Member 86
       
      I don't know the file backup procedure in gedit. It probably involves a temporary file that it deletes afterwards. But I don't know how to work around this issue.
      I even wonder if it works for anyone.
      0
  2. commentcamarcheeay Posted messages 735 Status Member 86
     
    Hello,

    I found a solution to back up my files. But it's not the best one, I hope to find something better.

    First, you need to enable backup settings:
    Edit > Preferences > Editor > Create a backup copy of files before saving

    Now the backup is done in two steps; on the first click, I receive the error message I mentioned regarding Error renaming temporary file: Text file busy. We cancel the message and the second click on the save button now allows it to be done.

    As you can see, this allows for backup, but using gedit is still inconvenient since I have to click three times instead of once each time. In the absence of alternatives, I will use this method until the chosen one appears!

    Thank you for the previous interventions.

    --
    C. Taha
    1
    1. Google
       
      I have the same problem with a virtual machine and a shared folder using the following command:
      sudo mount -t vboxsf share Public
      What should I do?
      0
    2. Google
       
      Moreover, it creates lots of .goutputstream-XXXXX files in the folder where I try to save the modified file with Geany or Gedit (no problems with Eclipse or QtCreator... wtf?)
      0
    3. Google
       
      This problem does not occur if the file is located in a "normal" folder (not mounted).
      0
    4. commentcamarcheeay Posted messages 735 Status Member 86
       
      Indeed, this problem only occurs with mounted drives (presumably from an NTFS system) and not with local files.

      What I did to work around this is that I enabled the option "Create a backup copy of files before saving."
      To save, I press ctrl+s, alt+n, ctrl+s instead of the usual ctrl+s.

      I have not yet found a definitive solution.
      0
  3. synopsis8 Posted messages 1478 Status Member 243
     
    Have you tried running an lsof from the VirtualBox client to see which process was accessing the file?
    0
    1. commentcamarcheeay Posted messages 735 Status Member 86
       
      My client system is Windows 7.
      I have no application using this file. The only program running, apart from system processes, is my vmbox.
      I don't think it's a matter of a file being open by another program. I checked that carefully. The proof is that I can modify the file using vim and I can delete or move it.
      I think we need to focus on gedit and the way it saves, which probably creates intermediate files.

      Thanks anyway!
      0
  4. synopsis8 Posted messages 1478 Status Member 243
     
    So if it's not a process, and it only affects files that have already been opened with GEDIT, it's a swap file; I have no other explanation.
    0
  5. juncode Posted messages 1 Status Member
     
    It seems to be an old unresolved issue, documented here
    https://bugzilla.gnome.org/show_bug.cgi?id=656225
    -1
    1. commentcamarcheeay Posted messages 735 Status Member 86
       
      It seems to be the answer to the question.
      I will mark the topic as resolved pending verification.
      Thank you for your response.
      0