Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm having issues with gedit saving files on a CIFS mounted share.
The system I'm using is an OpenSuse 10.3. And I have my Windows shared mounted as a CIFS filesystem.
I am mounting the CIFS with default permissions/parameters.
And the "mount" command displays it mounted as:
"type cifs (rw,mand)"
What I'm encountering is that gedit can not modify any files on this CIFS filesystem; not even a file it just created.
Gedit can create a file on this CIFS filesystem. But it can only save the file once. Any additional saves will fail.
The message that gets displayed is a non-informative:
"Could not save the file: $FILENAME"
I can not find ANY errors in log files OR even at the commandline when I start gedit from the prompt.
BUT all other programs; vi, touch, cat, emacs, sed, etc..; do not have any problems making changes to these very same files.
Has anyone else experienced this behavior from gedit ?
I'm probably not the only person who has ever encountered this situation.
So just in case someone else ever encounters the same situation; I'll post some of my own investigation.
Running an strace on gedit during one of these failures and logging it. I've noticed this output:
Starting a log and using strace:
Code:
> script -a eric.log 2>&1
> strace gedit eric.tmp
Portion of log where I think it is failing to save the file:
What kind of windows system is this. There is a bug with the Windows home server that doesn't allow you to edit files, even using Windows. You need to copy the file to your client machine, edit it, and then replace the original.
It sounds like it may be a locking problem.
From the Samba HOWTO & Reference Guide:
Code:
The second class of locking is the deny modes. These are set by an application
when it opens a file to determine what types of access should be allowed
simultaneously with its open. A client may ask for DENY NONE, DENY READ,
DENY WRITE, or DENY ALL. There are also special compatibility modes called
DENY FCB and DENY DOS.
I'm not sure if this is the responsibility of the client or the cifs kernel driver.
From "Advanced Programming in the Unix Environment"
Code:
O_CREAT Create the file if it doesn't exist. ...
O_EXCL Generate an errro if O_CREAT is also specified and the file already exists.
Notice the first two lines of your strace segment. The first call fails. That is because the file already existed and tlhe O_CREAT & O_EXCL flags were used. So gedit tried again. This time in Read/Write mode. So far, this looks OK.
This error occurred when gedit tried to rename the file to a temporary name "eric.tmp~". This file has a file handle (fd) of 16. I think that for windows, the file should be closed before renaming. For an inode based filesystem, this wouldn't be a problem. You can rename a file, but still retain the same inode that you opened. (even if you deleted the file)
Note that you could have left out later lines where gedit handled this situation.
One problem may be Windows' CIFS support not being up to par.
Can you try a different editor? (Or rhetorically, a Samba server )
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.