unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Vincent Lefevre <vincent@vinc17.net>
Cc: 18851@debbugs.gnu.org
Subject: bug#18851: 24.4; emacs cannot be started if the current directory has been removed
Date: Wed, 29 Oct 2014 16:23:24 +0200	[thread overview]
Message-ID: <83sii70xb7.fsf@gnu.org> (raw)
In-Reply-To: <20141029080939.GT4400@xvii.vinc17.org>

> Date: Wed, 29 Oct 2014 09:09:39 +0100
> From: Vincent Lefevre <vincent@vinc17.net>
> Cc: rgm@gnu.org, 18851@debbugs.gnu.org
> 
> > Because Emacs needs to pretend to the user that it runs _in_ that
> > directory, so that relative file names work as you'd expect.
> 
> I don't expect anything about reative file names. But if I type
> "emacs foo", opening file "foo" from $HOME would be bad.
> 
> > In this regard, Emacs is like the shell.
> 
> The shell has no problems when the current directory has been
> removed. It can still run without needing to switch to $HOME.

We are in violent agreement here.  I wasn't advocating to change to
HOME instead; quite the contrary: Glenn asked whether doing so is
worth the trouble, and I replied that I didn't think so.

> > > Note that the current directory can also be removed after Emacs
> > > is started, so I expect that Emacs already supports cases like
> > > that.
> > 
> > No, it does not.  Either the OS leaves the directory in existence
> > until Emacs exits, or the OS prevents you from removing it.
> 
> Linux does neither.

AFAIK, GNU/Linux does the former.  The directory is not physically
removed until the last process that has an open file descriptor for it
closes that descriptor.  Any attempts to reference that directory for
obtaining a new descriptor will get ENOENT, i.e. the OS pretends that
the directory doesn't exist.  But existing descriptors are valid, and
can be used as usual.





  parent reply	other threads:[~2014-10-29 14:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 13:33 bug#18851: 24.4; emacs cannot be started if the current directory has been removed Vincent Lefevre
2014-10-28 21:34 ` Glenn Morris
2014-10-29  1:28   ` Vincent Lefevre
2014-10-29  3:50     ` Eli Zaretskii
2014-10-29  8:09       ` Vincent Lefevre
2014-10-29 12:57         ` Stefan Monnier
2014-10-29 14:27           ` Eli Zaretskii
2014-10-29 15:39             ` Vincent Lefevre
2014-10-29 16:07               ` Eli Zaretskii
2014-10-29 16:44                 ` Vincent Lefevre
2014-10-29 16:15               ` Andreas Schwab
2014-10-29 16:51                 ` Vincent Lefevre
2014-10-29 17:31                   ` Andreas Schwab
2014-10-29 17:45                     ` Vincent Lefevre
2014-10-29 18:23                       ` Ivan Shmakov
2014-10-29 21:11                         ` Andreas Schwab
2014-10-30  0:39               ` Stefan Monnier
2015-06-12  0:39                 ` Glenn Morris
2015-06-12  7:53                   ` Eli Zaretskii
2015-06-12 15:45                     ` Glenn Morris
2015-06-12 19:31                       ` Eli Zaretskii
2015-06-13  1:29                         ` Glenn Morris
2015-06-13  7:56                           ` Eli Zaretskii
2015-06-13 23:45                             ` Glenn Morris
2014-10-29 14:23         ` Eli Zaretskii [this message]
2014-10-29 15:39           ` Andreas Schwab
2014-10-29 16:00             ` Eli Zaretskii
2014-10-29 16:05           ` Vincent Lefevre
2014-10-29 16:21             ` Eli Zaretskii
2014-10-29  3:40   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83sii70xb7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=18851@debbugs.gnu.org \
    --cc=vincent@vinc17.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).