[M3devel] rmrec problems

Olaf Wagner wagner at elegosoft.com
Wed Aug 4 11:21:57 CEST 2010


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

> There seems to another final problem, or maybe this was the problem   
> all along, or maybe maybe I introduced this with the previous fix (*)
> stat on a symlink whose target has been deleted, apparently fails.
> e.g. m3cc/target/gmp/.libs/libgmp.la -> ../libgmp.la
>
> *: maybe I introduced it: Well, before it might have been sensitive   
> to directory enumeration order.
> My change deletes files and then subdirectories, making it no longer  
>  sensitive that way.
>
> Fix will be to use lstat I believe.
>
> And I'll just report symlinks to be regular files.

Treating symbolic links as files for the simple needs of the FSUtils
module sounds OK, but the rm should of course only remove the link.
I assume that's what you've done though, as removing the real file
would require computing the real path.

> And opening them can fail with file not found... which I'm sure will  
>  break something somewhere -- enumerated files no longer necessarily  
>  exist...

Sounds OK, too.

> Probably no win.
>
> Probably the original interfaces didn't consider symlinks, since   
> they aren't portable.
> Yet without considering them, and composing rmrec on lower level   
> suppostedly portable interfaces..you can't ignore them.
> Can't win.

Yes, the old interface are portable, but not really sufficient
for more sophisticated file systems which are more or less standard
these days. Perhaps a careful review/redesign of this area would be
a good idea, too.

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