+ break;
+
case 'r':
use_ref = true;
ref_file = optarg;
*/Marc Abramowitz <address@hidden>/* wrote:
The other day I realized that often when I'm using touch, I'd like
it to have the ability to create ancestor directories that don't
exist, a la mkdir -p. I quickly hacked together a shell script to do
what I want:
http://marc.abramowitz.info/archives/2006/12/22/adding-a-p-option-to-touch/
Then I thought that this might be a generally useful extension to
touch, so I thought I'd take a stab at adding it to touch. Here it is:
--- coreutils-6.7.orig/src/touch.c 2006-10-22 09:54:15.000000000 -0700
+++ coreutils-6.7/src/touch.c 2006-12-28 13:45:22.000000000 -0800
@@ -34,6 +34,8 @@
#include "safe-read.h"
#include "stat-time.h"
#include "utimens.h"
+#include "savewd.h"
+#include "mkdir-p.h"

fd = fd_reopen (STDIN_FILENO, file,
O_WRONLY | O_CREAT | O_NONBLOCK | O_NOCTTY,
This feels fairly hacky to me, as there's a fair amount of code
duplication from mkdir.c - my hope is that the coreutils maintainers
can take this and clean it up, perhaps by moving some of the common
functionality into the lib directory.
I hope this is useful. Happy holidays all.
-Marc
http://marc.abramowitz.info/
--
Marc Abramowitz