bugGNU nano - Bugs: bug #42373, reading in a file into another...


bug #42373: reading in a file into another leaves a lock file behind

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Thu 15 May 2014 09:15:56 PM UTC  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Chris Allegretta <astyanax>
Open/Closed: ClosedRelease: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Wed 14 Jan 2015 08:44:41 PM UTC, comment #3:

Hi Chris. It worked well during the first five minutes of testing...

However, the error message in delete_lockfile() is of very little use, because when it gets triggered, either nano closes or immediately switches to another buffer, so it would be visible for maybe a millisecond. And in the current situation in never gets shown anyway -- even when I add a sleep(2) after the message (and then test it by making the dir unwritable after nano has opened a file), nothing gets shown. The flushing of the statusbar to the screen is missing.

Oh, the response to 'src/nano TODO/file' (opening a file in nonexistent directory that has the name of an existing file) is interesting: Cancelled.

And the response to 'src/nano nothing/file' is no longer that there was an error writing the lock file; instead there is no complaint at all -- until the first character is typed; then it warns about editing an unlocked file.

In both these cases it should complain that an invalid directory name was used, and then skip the file.

Benno Schulenberg <bens>
Project Member
Wed 14 Jan 2015 02:37:18 AM UTC, comment #2:

Hey Benno, this should be fixes as of r5104. Hopefully this fix didn't break something else, let me know if you do find something.

Chris Allegretta <astyanax>
Project AdministratorIn charge of this item.
Sun 18 May 2014 10:44:12 AM UTC, comment #1:

It seems it has to do with reading in another file. To reproduce, do: 'nano stuck', then type ^R TODO <Enter> ^X <Y> <Enter>, and then see how there is still a .stuck.swp file.

Benno Schulenberg <bens>
Project Member
Thu 15 May 2014 09:15:56 PM UTC, original submission:

Since a few days I have 'set locking' in my .nanorc file, and twice a day or so I get the message that someone else is editing the file I'm trying to open -- but the PID given in the message is long gone. I haven't figured out yet when this occurs.

(I normally use several nanos in parallel, in different directories, so it shouldn't really be possible for this to happen.)

Benno Schulenberg <bens>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by astyanax (Posted a comment)
  • -unavailable- added by bens (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 23 Mar 2015 06:26:36 PM UTCbensStatusReady For Test=>Fixed
    Wed 14 Jan 2015 02:37:18 AM UTCastyanaxStatusNone=>Ready For Test
      Assigned toNone=>astyanax
    Tue 17 Jun 2014 08:32:43 PM UTCbensSummaryQuite often nano finds a stale lock file=>reading in a file into another leaves a lock file behind

    Back to the top

    Powered by Savane 3.1-cleanup