Mail Archives: djgpp-workers/2001/05/12/11:37:41
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 -