delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/05/12/11:37:41

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3AFD5893.90EEFA5A@phekda.freeserve.co.uk>
Date: Sat, 12 May 2001 16:36:51 +0100
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.17 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: ANNOUNCE: Fileutils 4.0 beta 2
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010508100734 DOT 3965B-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Eli Zaretskii wrote:
> 
> On Mon, 7 May 2001, Richard Dawe wrote:
> > * I had not made 'rm -r' aware of multiple working directories, one
> > per drive. If you use a drive specifier, 'rm -r' now saves the current
> > drive's and the directory's drive's working directory.
> 
> Alternatively, you could change it to chdir to the root of the current
> drive before returning from another drive.  Since the root directory
> cannot be removed, it is safe to leave the root as the cwd.
> 
> I don't know which way is better.  If the changes you did are clean
> enough, I think it's an okay solution.

Since my solution works, I will keep it.

> How did the previous port of v3.16 avoid this?

v3.16 did not change in to the directory before removing it. It removed
the directory without chdir()'ing into it, so it is not vunerable to this
problem. I guess v4.0 chdir()'s to avoid problems on some systems.

> Just for the record: I remember playing a lot with floppies, making
> and removing directories on them, back when I worked on porting
> Fileutils, probably because I didn't want to risk corrupting my hard
> disk.  I found lots of subtle bugs that way.

That sounds like a good technique. You've already found a couple of bugs
in v4.0 using it. A couple of tests in the test suite can be told to use a
different physical device. For some reason it never occurred to me to use
a:. Thanks for the tip!

Thanks, bye, Rich =]

-- 
Richard Dawe
http://www.phekda.freeserve.co.uk/richdawe/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019