From: Andrea Arcangeli <andrea@suse.de>
To: "Mohammad A. Haque" <mhaque@haque.net>
Cc: linux-kernel@vger.kernel.org, Alexander Viro <viro@math.psu.edu>
Subject: Re: `rmdir .` doesn't work in 2.4
Date: Mon, 8 Jan 2001 18:55:18 +0100 [thread overview]
Message-ID: <20010108185518.G27646@athlon.random> (raw)
In-Reply-To: <20010108180857.A26776@athlon.random> <Pine.LNX.4.30.0101081230160.15703-100000@viper.haque.net>
In-Reply-To: <Pine.LNX.4.30.0101081230160.15703-100000@viper.haque.net>; from mhaque@haque.net on Mon, Jan 08, 2001 at 12:31:29PM -0500
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 foooooo
> touch: foooooo: Operation not permitted
> bash# ls
>
> Whats the point of it?
To type less characters. I'll show you the code that is failing:
def binutils():
print 'Checking out binutils'
sys.stdout.flush()
os.chdir(binutils_dir)
if os.system('%s update -A -d -P' % CVS):
print 'failed binutils checkout'
sys.exit(1)
print 'Compiling and installing binutils'
sys.stdout.flush()
os.chdir('..')
binutils_build = 'binutils-build-%s' % BUILD
os.mkdir(binutils_build)
os.chdir(binutils_build)
if os.system('../binutils/configure --target=x86_64-unknown-linux --prefix=%s && make && make install' % install_dir):
print 'failed binutils compile'
sys.exit(1)
shutil.rmtree(".")
Why should I write:
os.chdir("..")
shutil.rmtree(binutils_build)
when I can simply write:
shutil.rmtree(".")
I know in the above case I really could avoid the os.chdir(binutils_build) and
to use `cd %s; ...` % (binutils_dir, install_dir) and probably
it wouldn't make much difference, but the above looks simpler and I may have
other things to run while inside the binutils_dir too so it could make lots of
sense to os.chdir there as I just did.
To workaround this misfeature I can simply implement a derivative class of
shutil in my robot and to wrap the rmtree method to emulate the 2.2.x behaviour
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 good idea, there are many more overhead things that matters more
and that aren't even visible to userspace)
Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2001-01-08 17:55 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-08 17:08 `rmdir .` doesn't work in 2.4 Andrea Arcangeli
2001-01-08 17:31 ` Mohammad A. Haque
2001-01-08 17:55 ` Andrea Arcangeli [this message]
2001-01-08 18:04 ` Alexander Viro
2001-01-08 20:30 ` Andrea Arcangeli
2001-01-08 21:08 ` Alexander Viro
2001-01-08 21:56 ` Andrea Arcangeli
2001-01-08 23:28 ` Linus Torvalds
2001-01-09 8:09 ` Stefan Traby
2001-01-09 10:48 ` Eric Lammerts
2001-01-09 9:31 ` Albert D. Cahalan
2001-01-09 15:00 ` Alexander Viro
2001-01-09 20:59 ` Albert D. Cahalan
2001-01-09 21:42 ` Alexander Viro
2001-01-08 23:27 ` Linus Torvalds
2001-01-09 0:01 ` Andrea Arcangeli
2001-01-09 13:50 ` Stephen C. Tweedie
2001-01-08 17:58 ` Alexander Viro
2001-01-08 20:28 ` Andrea Arcangeli
2001-01-09 13:52 ` Stephen C. Tweedie
2001-01-08 21:54 ` Stefan Traby
2001-01-08 22:11 ` Benson Chow
2001-01-08 22:37 ` Andrea Arcangeli
2001-01-09 1:37 ` Wakko Warner
2001-01-09 1:55 ` Andrea Arcangeli
2001-01-09 4:56 ` Marc Lehmann
2001-01-11 18:57 ` Bernhard Rosenkraenzer
2001-01-09 13:39 ` Alexander Viro
2001-01-12 18:27 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2001-01-08 20:56 Andries.Brouwer
2001-01-08 21:34 ` Andrea Arcangeli
2001-01-10 22:25 ` Matthias Andree
2001-01-08 22:50 Andries.Brouwer
2001-01-08 23:22 ` Andrea Arcangeli
2001-01-09 17:02 ` Kurt Roeckx
2001-01-09 12:18 Andries.Brouwer
2001-01-09 13:41 Jesse Pollard
2001-01-09 14:06 ` Andrea Arcangeli
2001-01-10 14:47 ` Stephen C. Tweedie
2001-01-10 15:03 ` Andrea Arcangeli
2001-01-10 17:28 ` Alexander Viro
2001-01-10 17:38 ` Andrea Arcangeli
2001-01-09 14:23 ` Alexander Viro
2001-01-09 14:38 Jesse Pollard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010108185518.G27646@athlon.random \
--to=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mhaque@haque.net \
--cc=viro@math.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.