gnu-arch-users
[Top][All Lists]
Advanced

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

[Gnu-arch-users] Re: A Crystal Clear Statement of the Path problem


From: Tom Lord
Subject: [Gnu-arch-users] Re: A Crystal Clear Statement of the Path problem
Date: Tue, 23 Sep 2003 10:06:47 -0700 (PDT)

    > From: Michael Grubb <address@hidden>

    > There doesn't seem to be a limit on tree depth. Only path
    > length.

That's excellent news.   That's the easier fix.

These are pretty easy (and all have he same solution):

        access
        chdir
        chmod
        chown
        chroot
        mkdir
        open
        opendir
        rmdir
        stat
        truncate
 

These are slightly nasty:

        link
        rename


This one is just weird:

        symlink

and the rest just fall-through to vu_sys_* functions.


`symlink' is weird in the sense that the destination path (the name of
the link being created) is easy to handle (works like `open').  But
presumably the link itself is length limited and there's nothing at
all that can be done about that.  Oh well.  arch itself doesn't make
up link target paths and, thus, never makes up very long ones itself
-- so this limitation won't effect arch.

`link' and `rename' kinda suck.   I'm not sure you can fix them
without making intermediate temporary files, which then have to be
torn-down at the end (or upon error).    That changes the semantics of
these calls pretty drastically.

One issue is that you'll have to assume write access to the locations
of the intermediate temp files.  Oh well (shouldn't be a problem in
arch, at least).

The other issue is atomicity of `rename'.   To get it right, you'll
need to build a `link' chain from the source path to destination path,
and then unlink the original and link chain.   Don't try to do it by 
just renaming through intermediate names -- because that violates the
condition that at least one of the original and destination name must
exist at all times during a call to `rename'.


-t





reply via email to

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