Quick question: recursive touch?

John Mitchell johnm at magnet.com
Tue Oct 5 15:21:22 EDT 1999


On Tue, 5 Oct 1999, Preston Landers wrote:

> Sorry to answer my own question, but I wrote a primitive little
> implementation of my request pending discovery of 'the official
> version.'  Note that mine actually uses the unix touch command but it
> could easily be modified to use the more portable python open(file, "w")
> [100-lines of python deleted]

you could also try this (csh):

	set path=/tmp/test/path/here.txt

	mkdir -p $path:h	# make dir and all parent dirs

	touch $path		# create a zero-length file


- j






More information about the Python-list mailing list