Bug 657875 - nano thinks file has been modified under it when saving
Summary: nano thinks file has been modified under it when saving
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: nano
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: David Woodhouse
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-28 14:53 UTC by Charles R. Anderson
Modified: 2011-09-04 19:19 UTC (History)
3 users (show)

Fixed In Version: nano-2.2.6-2.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-04 18:06:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Charles R. Anderson 2010-11-28 14:53:23 UTC
Description of problem:

When saving a file in nano, sometimes it thinks the file was modified outside of nano while you were editing it inside nano, and then it warns you "File was modified since you opened it, continue saving ?".

Version-Release number of selected component (if applicable):
nano-2.2.6-1.fc15.x86_64

How reproducible:
almost always

Steps to Reproduce:
1. create a new file and edit it with nano
2. modify the file inside nano
3. ctrl-o to save file, or ctrl-x, y to save and exit
4. try repeating 2-3 a couple times if it doesn't happen the first time

Actual results:

File was modified since you opened it, continue saving ?                        
 Y Yes
 N No           ^C Cancel

Expected results:

Nothing modified the file since I opened it.  It shouldn't ask.

Additional info:

Comment 1 Kamil Dudka 2010-11-28 17:31:44 UTC
Please provide the output of stat(1) for the edited file:

1) before editing the file

2) before attempting to save the changes

3) after the dialog appears

Comment 2 Charles R. Anderson 2010-11-28 18:59:47 UTC
Before editing file in nano:

[install@l ~]$ stat test
  File: `test'
  Size: 451             Blocks: 8          IO Block: 4096   regular file
Device: fd02h/64770d    Inode: 262165      Links: 1
Access: (0664/-rw-rw-r--)  Uid: (  500/ install)   Gid: (  500/ install)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2010-11-28 13:46:38.140528974 -0500
Modify: 2010-11-28 13:48:07.422529000 -0500
Change: 2010-11-28 13:48:07.422529000 -0500
 Birth: -

After opening file in nano but not making any changes:

[install@l ~]$ stat test
  File: `test'
  Size: 451             Blocks: 8          IO Block: 4096   regular file
Device: fd02h/64770d    Inode: 262165      Links: 1
Access: (0664/-rw-rw-r--)  Uid: (  500/ install)   Gid: (  500/ install)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2010-11-28 13:48:58.081529013 -0500
Modify: 2010-11-28 13:48:07.422529000 -0500
Change: 2010-11-28 13:48:07.422529000 -0500
 Birth: -

After not making any changes to the contents, but saving over the file anyway with Ctrl-o (no warning dialog appears for this save).  Here is the stat after the save:

[install@l ~]$ stat test
  File: `test'
  Size: 451             Blocks: 8          IO Block: 4096   regular file
Device: fd02h/64770d    Inode: 262165      Links: 1
Access: (0664/-rw-rw-r--)  Uid: (  500/ install)   Gid: (  500/ install)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2010-11-28 13:48:58.081529013 -0500
Modify: 2010-11-28 13:49:11.858529298 -0500
Change: 2010-11-28 13:49:11.858529298 -0500
 Birth: -

After still not making any changes to the contents, but attempting to save over the file with Ctrl-o for a second time, the warning dialog appears and stat shows this before actually saving the file a second time:

[install@l ~]$ stat test
  File: `test'
  Size: 451             Blocks: 8          IO Block: 4096   regular file
Device: fd02h/64770d    Inode: 262165      Links: 1
Access: (0664/-rw-rw-r--)  Uid: (  500/ install)   Gid: (  500/ install)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2010-11-28 13:48:58.081529013 -0500
Modify: 2010-11-28 13:49:11.858529298 -0500
Change: 2010-11-28 13:49:11.858529298 -0500
 Birth: -

Comment 3 Kamil Dudka 2010-11-28 19:48:31 UTC
Thanks, confirmed, will be fixed shortly.

Comment 4 Kamil Dudka 2010-11-28 20:13:17 UTC
Please try nano-2.2.6-2.fc15:

http://koji.fedoraproject.org/koji/buildinfo?buildID=206774

Comment 6 Charles R. Anderson 2011-09-04 18:06:08 UTC
Haven't seen this problem anymore, must be fixed :-)

Comment 7 Kamil Dudka 2011-09-04 19:19:32 UTC
Great.  Thanks for the feedback!


Note You need to log in before you can comment on or make changes to this bug.