bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18851: 24.4; emacs cannot be started if the current directory has be


From: Eli Zaretskii
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

> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]