Mail Archives: djgpp/2000/03/08/08:46:59
On Wed, 8 Mar 2000, nimrod a. abing wrote:
> BTW: I read in the rm info page that rm -d will:
>
> Remove directories with `unlink' instead of
> `rmdir', and don't require a directory to be
> empty before trying to unlink it. Only
> works if you have appropriate privileges.
> Because unlinking a directory causes any files
> in the deleted directory to become
> unreferenced, it is wise to `fsck' the
> filesystem after doing this.
>
> This is why I am pretty sure that my misuse of
> rm caused all this.
I don't see how this could happen. When you pass the -d switch, rm
simply calls the `unlink' function, which in the DJGPP incarnation is
the same as `remove'. This eventually causes the program to call
function 3Ah or 713Ah of Interrupt 21h, which tries to remove the
directory. DOS and Windows don't allow to remove a non-empty
directory, so all you should get is an error message.
I just tried "rm -d foo" (where `foo' is a non-empty directory) on my
Windows 95 system, and all I get is this:
rm: foo: Permission denied (EACCES)
which is what I'd expect. So I think your unmovable blocks are not
caused by rm.
The fragment from the manual which you cited above has no bearing on
the DJGPP port, since you cannot unlink a non-empty directory on
systems supported by DJGPP. In other words, the system calls used by
`rmdir' and `unlink' functions are identical in the DJGPP library. So
the -d switch is largely a no-op in the DJGPP port.
> If anyone out there knows of an fsck workalike, plz let me know.
It's called SCANDISK on Windows.
- Raw text -