Hi!
> The bottom line: rmdir(".") is gone. Replace it with portable equivalent,
> namely
> p = getcwd(pwd, sizeof(pwd));
> if (!p)
> /* handle error - ERANGE or ENOENT */
> rmdir(p);
> Shell equivalent is rmdir `pwd`. Also portable.
...when you are lucky and all d
On Mon, 8 Jan 2001, Benson Chow wrote:
> Not very portable at all...
>
> hpux = HP/UX 10.2
>
> hpux:~/foo$ rmdir .
> rmdir: cannot remove .. or .
Same on FreeBSD, by the way
bash-2.04# uname -a
FreeBSD freebsd.redhat.de 5.0-20001112-CURRENT FreeBSD 5.0-20001112-CURRENT
#0: Sun Nov 12 14:04:55 G
On Mon, 08 Jan 2001, Andrea Arcangeli wrote:
> On Mon, Jan 08, 2001 at 09:56:18PM +0100, [EMAIL PROTECTED] wrote:
> Hardlinks have nothing to do with `rmdir .`. See rmdir . as the equivalent
> pointed out by Alexander: "rmdir `pwd`". `pwd` returns the same thing
You can't delete immutable direc
On Wed, Jan 10, 2001 at 12:28:38PM -0500, Alexander Viro wrote:
> That's precisely what I've already done. grep for IS_DEADDIR() and notice
Fine ;)
Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ a
On Wed, 10 Jan 2001, Andrea Arcangeli wrote:
> > Do we have enough protection to ensure this for other filesystems?
>
> Note that this has nothing to do with `rmdir .`. You will run into the
> mentioned issue just now with '''rmdir "`pwd`"'''. I've not checked
> the other fses but I would put
On Wed, Jan 10, 2001 at 02:47:35PM +, Stephen C. Tweedie wrote:
> Hi,
>
> On Tue, Jan 09, 2001 at 03:06:35PM +0100, Andrea Arcangeli wrote:
> > On Tue, Jan 09, 2001 at 07:41:21AM -0600, Jesse Pollard wrote:
> > > Not exactly valid, since a file could be created in that "pinned" directory
> >
Hi,
On Tue, Jan 09, 2001 at 03:06:35PM +0100, Andrea Arcangeli wrote:
> On Tue, Jan 09, 2001 at 07:41:21AM -0600, Jesse Pollard wrote:
> > Not exactly valid, since a file could be created in that "pinned" directory
> > after the rmdir...
>
> In 2.2.x no file can be created in the pinned director
On Tue, 9 Jan 2001, Albert D. Cahalan wrote:
> As long as nobody tried to remove ".", nothing is serialized.
> You can do your lookups in parallel since they can all grab
> the read lock at once.
Bzzzert. At which point do you take that lock for rmdir("foo/bar/barf/.")?
> Linux can tell where
Alexander Viro writes:
> On Tue, 9 Jan 2001, Albert D. Cahalan wrote:
>> Alexander Viro writes:
>>
>>> [...] If you really need to destroy the directory
>>> that happens to be your pwd - sorry, no reliable way to do that without
>>> interesting locking. On _any_ UNIX out there. 2.2 included. It wi
On Mon, Jan 08, 2001 at 11:50:44PM +0100, [EMAIL PROTECTED] wrote:
> From: Andrea Arcangeli <[EMAIL PROTECTED]>
>
> > But in fact it fails with EINVAL, and
> >
> > [EINVAL]: The path argument contains a last component that is dot.
>
> I can't confirm. The specs I'm checking
On Tue, 9 Jan 2001, Albert D. Cahalan wrote:
> Alexander Viro writes:
>
> > [...] If you really need to destroy the directory
> > that happens to be your pwd - sorry, no reliable way to do that without
> > interesting locking. On _any_ UNIX out there. 2.2 included. It will
> > happily give you
> On Tue, 9 Jan 2001, Jesse Pollard wrote:
>
> > Not exactly valid, since a file could be created in that "pinned" directory
> > after the rmdir...
>
> No, it couldn't (if you can show a testcase when it would - please do, you've
> found a bug). Moreover, busy directories can be removed in 2.4
On Tue, 9 Jan 2001, Jesse Pollard wrote:
> Not exactly valid, since a file could be created in that "pinned" directory
> after the rmdir...
No, it couldn't (if you can show a testcase when it would - please do, you've
found a bug). Moreover, busy directories can be removed in 2.4 quite fine -
On Tue, Jan 09, 2001 at 07:41:21AM -0600, Jesse Pollard wrote:
> Not exactly valid, since a file could be created in that "pinned" directory
> after the rmdir...
In 2.2.x no file can be created in the pinned directory after the rmdir.
Andrea
-
To unsubscribe from this list: send the line "unsubs
Alexander Viro writes:
> [...] If you really need to destroy the directory
> that happens to be your pwd - sorry, no reliable way to do that without
> interesting locking. On _any_ UNIX out there. 2.2 included. It will
> happily give you -ENOENT and refuse to perform the action above in
> case if
Hi,
On Mon, Jan 08, 2001 at 09:28:33PM +0100, Andrea Arcangeli wrote:
> On Mon, Jan 08, 2001 at 12:58:20PM -0500, Alexander Viro wrote:
> > It's a hell of a pain wrt locking. You need to lock the parent, but it can
>
> This is a no-brainer and bad implementation, but shows it's obviously right
>
Hi,
On Tue, Jan 09, 2001 at 01:01:25AM +0100, Andrea Arcangeli wrote:
> On Mon, Jan 08, 2001 at 03:27:21PM -0800, Linus Torvalds wrote:
> > However, it is against all UNIX standards, and Linux-2.4 will explicitly
>
> I may be missing something but apparently SuSv2 allows it, you can check here:
- Received message begins Here -
>
> Hello Al,
>
> why `rmdir .` is been deprecated in 2.4.x? I wrote software that depends on
> `rmdir .` to work (it's local software only for myself so I don't care that it
> may not work on unix) and I'm getting flooded by failing cronjobs
On Mon, 8 Jan 2001, Stefan Traby wrote:
> On Mon, Jan 08, 2001 at 12:58:20PM -0500, Alexander Viro wrote:
>
> > Shell equivalent is rmdir `pwd`. Also portable.
>
> Very portable - not.
>
> rmdir "`pwd`" !!!
OK, got me on that. Yes, you'll need quoting here. Sorry.
Notice that there
> I trust your specs said so, however I'm not sure which are the specs
> we should follow for Linux.
> At least for LFS 2.2.x fixage I always followed the SuSv2 specs
We are Linux, and free to do whatever we want.
However, following POSIX makes a large body of software available.
It would be ver
On Tue, 9 Jan 2001, Stefan Traby wrote:
> "rmdir `pwd`" is required to fail (at least under csh, bash, ksh) if the
> path component contains a white space and thereof it can't be a valid
> replacement for Andreas "rmdir ." which was what Al initially suggested.
>
> Yes, I'm very pickey about that
On Mon, Jan 08, 2001 at 03:28:29PM -0800, Linus Torvalds wrote:
> But at least "rmdir `pwd`" is not _required_ to fail, like rmdir("."/"..").
"rmdir `pwd`" is required to fail (at least under csh, bash, ksh) if the
path component contains a white space and thereof it can't be a valid
replacement
On Tue, Jan 09, 2001 at 02:55:15AM +0100, Andrea Arcangeli <[EMAIL PROTECTED]> wrote:
> > [wakko@:/home/wakko/test] rmdir "`pwd`"
> > rmdir: /home/wakko/test: Invalid argument
>
> Some other OS with a yet different retval? :)
It can be much worse (irix-6.5.4):
bash# mkdir x; cd x; rmdir "`pw
On Mon, Jan 08, 2001 at 08:37:22PM -0500, Wakko Warner wrote:
> [wakko@:/home/wakko/test] rmdir "`pwd`"
> rmdir: /home/wakko/test: Invalid argument
Some other OS with a yet different retval? :)
Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a mess
> Not very portable at all...
>
> hpux = HP/UX 10.2
>
> hpux:~$ mkdir foo
> hpux:~$ cd foo
> hpux:~/foo$ rmdir "`pwd`"
> rmdir: /home/blc/foo: Cannot remove mountable directory
> hpux:~/foo$ rmdir .
> rmdir: cannot remove .. or .
> hpux:~/foo$ rmdir /home/blc/foo
> rmdir: /home/blc/foo: Cannot r
On Mon, Jan 08, 2001 at 03:27:21PM -0800, Linus Torvalds wrote:
> However, it is against all UNIX standards, and Linux-2.4 will explicitly
I may be missing something but apparently SuSv2 allows it, you can check here:
http://www.opengroup.org/onlinepubs/007908799/xsh/rmdir.html
Infact S
In article <[EMAIL PROTECTED]>,
Andrea Arcangeli <[EMAIL PROTECTED]> wrote:
>On Mon, Jan 08, 2001 at 04:08:58PM -0500, Alexander Viro wrote:
>> Andrea, fix your code. Linux-only stuff is OK when there is no
>
>BTW, "rmdir `pwd`" is not portable either.
Indeed. Avoid it if you can.
But at l
In article <[EMAIL PROTECTED]>,
Andrea Arcangeli <[EMAIL PROTECTED]> wrote:
>On Mon, Jan 08, 2001 at 01:04:24PM -0500, Alexander Viro wrote:
>> Racy. Nonportable. Has portable and simple equivalent. Again, don't
>> bother with chdir at all - if you know the name of directory even
>> ../name will
On Mon, Jan 08, 2001 at 11:50:44PM +0100, [EMAIL PROTECTED] wrote:
> From: Andrea Arcangeli <[EMAIL PROTECTED]>
>
> > But in fact it fails with EINVAL, and
> >
> > [EINVAL]: The path argument contains a last component that is dot.
>
> I can't confirm. The specs I'm checking
From: Andrea Arcangeli <[EMAIL PROTECTED]>
> But in fact it fails with EINVAL, and
>
> [EINVAL]: The path argument contains a last component that is dot.
I can't confirm. The specs I'm checking are here:
http://www.opengroup.org/onlinepubs/007908799/xsh/rmdir.html
On Mon, Jan 08, 2001 at 03:11:08PM -0700, Benson Chow wrote:
> Not very portable at all...
>
> hpux = HP/UX 10.2
>
> hpux:~$ mkdir foo
> hpux:~$ cd foo
> hpux:~/foo$ rmdir "`pwd`"
> rmdir: /home/blc/foo: Cannot remove mountable directory
> hpux:~/foo$ rmdir .
> rmdir: cannot remove .. or .
> hpu
of it till it's done with it...
-bc
On Mon, 8 Jan 2001, Stefan Traby wrote:
> Date: Mon, 8 Jan 2001 22:54:51 +0100
> From: Stefan Traby <[EMAIL PROTECTED]>
> To: Alexander Viro <[EMAIL PROTECTED]>
> Cc: Andrea Arcangeli <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>
On Mon, Jan 08, 2001 at 04:08:58PM -0500, Alexander Viro wrote:
> Andrea, fix your code. Linux-only stuff is OK when there is no
BTW, "rmdir `pwd`" is not portable either.
> portable way to achieve the same result. In your situation such way indeed
> exists and is prefectly doable in userl
On Mon, Jan 08, 2001 at 12:58:20PM -0500, Alexander Viro wrote:
> Shell equivalent is rmdir `pwd`. Also portable.
Very portable - not.
rmdir "`pwd`" !!!
--
ciao -
Stefan
" ( cd /lib ; ln -s libBrokenLocale-2.2.so libNiedersachsen.so ) "
Stefan TrabyLinux/
On Mon, Jan 08, 2001 at 09:56:18PM +0100, [EMAIL PROTECTED] wrote:
> You think that it fails with EBUSY. That would be allowed but not required:
>
> [EBUSY]: The directory to be removed is currently in use by
> the system or some process and the implementation
> considers this t
On Mon, 8 Jan 2001, Andrea Arcangeli wrote:
> On Mon, Jan 08, 2001 at 01:04:24PM -0500, Alexander Viro wrote:
> > Racy. Nonportable. Has portable and simple equivalent. Again, don't
> > bother with chdir at all - if you know the name of directory even
> > ../name will work. It's not about the c
> why `rmdir .` is been deprecated in 2.4.x?
> `rmdir .` makes perfect sense, the cwd dentry remains pinned
You think that it fails with EBUSY. That would be allowed but not required:
[EBUSY]: The directory to be removed is currently in use by
the system or some process and the impleme
On Mon, Jan 08, 2001 at 01:04:24PM -0500, Alexander Viro wrote:
> Racy. Nonportable. Has portable and simple equivalent. Again, don't
> bother with chdir at all - if you know the name of directory even
> ../name will work. It's not about the current directory. It's about
> the invalid last compone
On Mon, Jan 08, 2001 at 12:58:20PM -0500, Alexander Viro wrote:
> It's a hell of a pain wrt locking. You need to lock the parent, but it can
This is a no-brainer and bad implementation, but shows it's obviously right
wrt locking. (pseudocode, I ignored the uaccess details and all the other not
re
On Mon, 8 Jan 2001, Andrea Arcangeli wrote:
> in userspace, but I think the old behaviour was more flexible (it was also
> showing how much our dcache is powerful) and I still don't see why it's been
> removed. Maybe it was to remove a branch from a fast path? (if so I don't
> think it was a g
On Mon, 8 Jan 2001, Andrea Arcangeli wrote:
> Hello Al,
>
> why `rmdir .` is been deprecated in 2.4.x? I wrote software that depends on
> `rmdir .` to work (it's local software only for myself so I don't care that it
> may not work on unix) and I'm getting flooded by failing cronjobs since I
On Mon, Jan 08, 2001 at 12:31:29PM -0500, Mohammad A. Haque wrote:
> I fail to see why this is useful. you can't do anything in the directory
> afterwards.
>
> bash# mkdir foobar
> bash# cd foobar/
> bash# ls
> bash# rmdir .
> bash# touch foo
> touch: foo: Operation not permitted
> bash#
I fail to see why this is useful. you can't do anything in the directory
afterwards.
bash# mkdir foobar
bash# cd foobar/
bash# ls
bash# rmdir .
bash# touch foo
touch: foo: Operation not permitted
bash# ls
Whats the point of it?
On Mon, 8 Jan 2001, Andrea Arcangeli wrote:
> Hello Al,
>
Hello Al,
why `rmdir .` is been deprecated in 2.4.x? I wrote software that depends on
`rmdir .` to work (it's local software only for myself so I don't care that it
may not work on unix) and I'm getting flooded by failing cronjobs since I put
2.4.0 on such machine. `rmdir .` makes perfect sense
44 matches
Mail list logo