[Openmcl-devel] Opening files on automounted file systems

Gary Byers gb at clozure.com
Wed Mar 31 05:39:26 PDT 2010

When you type a filename into Emacs (at the C-x C-f prompt and in
similar contexts), there's typically a lot of validation/completion
going on, with one result being that every part of the directory
hierarchy gets referenced (in left-to-right order) before the file's
actually opened. (Shells often do similar completion/validation of
pathnames.) I don't think that the "open" system call (CCL::FD-OPEN)
does this (it seems fairly likely that it doesn't), and it sort of rings
a bell that automounting depends on this. (In order for "mount on
demand" to work, something has to notice "demand".)

ENSURE-DIRECTORIES-EXIST does this same sort of left-to-right/top-down
traversal, so if this has anything to do with anything:

(let* ((p #p"/path/to/file/in/automounted/directory"))
   (multiple-value-bind (path created) (ensure-directories-exist p)
     (when created
       (error "Didn't expect anything to be created ..."))
     (open path ...)))

might work when OPEN doesn't.

CCL uses the same "open" system call as "ls" and Emacs do, so different
behavior would have to be ascribed to:

1) things that happen - by luck or design - before the open.
2) environmental differences (chroot) between execution contexts
3) Good Clean Living (or lack thereof.)

Sadly, even if one believes in explanations like (3) above ("but it works
in ____") as it sometimes seems that people do, it's way too late to do
anything about that ...

If a process fails to see/open files on an automounted filesystem even
after some other process has forced the mount to have occurred, then
that process has seemingly somehow discovered a way to have a different
view of the filesystem than its peers.  That's what "chroot" does; I
don't know of any way to do that without chroot being involved.

On Tue, 30 Mar 2010, Tim Bradshaw wrote:

> On 29 Mar 2010, at 19:29, Daniel Weinreb wrote:
>> CCL cannot open any files in a certain directory, whose
>> unusual characteristic is that it is automounted from
>> NFS.  Emacs has no trouble opening and reading the file,
>> "ls" shows it, and so on, but CCL says it's not there.
>> I looked at the CCL documentation but failed to
>> find anything about this.  Does anyone know?
> Is the file directly under the mountpoint?  If it is, does opening a
> file in a subdirectory of the mountpoint work? If it does, I would
> guess that something is asking if the file exists, when it does not,
> really, yet.
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel

More information about the Openmcl-devel mailing list