[M3devel] symlink grief?

Olaf Wagner wagner at elegosoft.com
Fri Sep 3 13:10:51 CEST 2010


Symbolic links usually `just work'.
If you have changed stat to lstat for all use cases, that will of
course cause problems. I thought your changes were local to the
rmrec implementation for quake. Aren't they?

If not, it will be better to revert them.

Olaf

PS: Windows NTFS does support symbolic links, too, though I've probably
never used them: http://en.wikipedia.org/wiki/NTFS_symbolic_link

Quoting Jay K <jay.krell at cornell.edu>:

>  +++ /cm3/bin/cm3  -ship -DROOT=/home/jay/dev2/cm3 +++
> --- shipping from I386_LINUX ---
>
> "/home/jay/dev2/cm3/m3-libs/m3core/I386_LINUX/.M3SHIP", line 1:   
> quake runtime error: unable to create directory "/cm3": errno=17
>
> --procedure--  -line-  -file---
> make_dir           --  <builtin>
>                     1  /home/jay/dev2/cm3/m3-libs/m3core/I386_LINUX/.M3SHIP
>
> Fatal Error: package build failed
>  *** execution of [<function _BuildGlobalFunction at 0xb7378844>,   
> <function _ShipFunc
>
>
> /cm3 is a symlink to /home/jay/cm3
> They both exist.
> /home/jay/cm3 is a directory.
>
> I predict no good answers here.
>  - a code base that historically used stat, that I changed to lstat.
>
> I think maybe I should put it back to stat.
> And maybe come up with new functions for fs_rmrec to use.
>
> Wild guess... we have code like:
>
>
> PROCEDURE IsDirectory (path: TEXT): BOOLEAN =
>   VAR s: File.Status;
>   BEGIN
>     TRY
>       s := FS.Status (path);
>       RETURN (s.type = FS.DirectoryFileType);
>     EXCEPT OSError.E =>
>       RETURN FALSE;
>     END;
>   END IsDirectory;
>
>
> Maybe the right thing is to mimic Posix and allow code like:
>
>
> PROCEDURE IsDirectory (path: TEXT): BOOLEAN =
>   VAR s: File.Status;
>   BEGIN
>     TRY
>       s := FS.LinkStatus (path);
>       RETURN (s.type = FS.SymblicLinkFileType);
>     EXCEPT OSError.E =>
>       RETURN FALSE;
>     END;
>   END IsDirectory;
>
> or such?
>
> Not sure it is needed.
>
> Or FS.StatusNoLinkResolve? Is that clearer?
>
> There are a few basic problems here:
>   - The "Modula-3 code base" has been written I assume without   
> symlinks in mind. ??
>   - I don't have symlinks in mind, much at all, since I'm usually   
> not on a system with them.
>   I don't have a mental model of how to program with them, etc.
>   Maybe some short document I can read and memorize?
>
>
>  - Jay
>



-- 
Olaf Wagner -- elego Software Solutions GmbH
                Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
    http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




More information about the M3devel mailing list