bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add create dir on touch


From: Eric Blake
Subject: Re: add create dir on touch
Date: Wed, 04 Jul 2007 15:56:01 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.12) Gecko/20070509 Thunderbird/1.5.0.12 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to KE Liew on 7/4/2007 8:14 AM:
> Rather than mkdir -P /path/to/wherever && touch /path/to/wherever/filename
> It's nicer to have touch -P /path/to/wherever/filename

Thanks for the suggestion.  However, it should be spelled -p, not -P.
Care to submit a patch?  Remember the documentation as well as the code.

On the other hand, I'm not sure whether the primary maintainer, Jim, is
willing to add new features - the problem with a new feature is that you
cannot rely on it in portable scripts, and if the action can portably be
done with existing tools (as you have just demonstrated), then we really
need justification before bloating touch.  I suppose you could argue that
by doing the directory and file creation all within a single process that
you can minimize the data races that would otherwise exist in between when
the one process creates the directory and the other process then tries to
create the file.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGjBdx84KuGfSFAYARAnxxAJwOJkx2XWg24bem1ofZrVV3vVIrqACgp1AU
A80Gn0pHXyZgRqknHvOylZw=
=jkwr
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]