All-
What Ruby command will delete all files within a directory. (I’m using Ruby on Windows.)
I’m trying to delete all files within the directory “output”, which is itself in the current directory.
I’ve tried various lines looking like this:
File.delete("./output/*")
But I keep getting “Invalid arguement” or “permission denied” errors.
Thanks for the help.
-Kurt
[22:10] drbrain@asx:~/ruby/tmp$ touch one two
[22:10] drbrain@asx:~/ruby/tmp$ ls
one two
[22:10] drbrain@asx:~/ruby/tmp$ ruby -e ‘File.delete(“one”, “two”)’
[22:10] drbrain@asx:~/ruby/tmp$ ls
[22:11] drbrain@asx:~/ruby/tmp$ touch one two
[22:10] drbrain@asx:~/ruby/tmp$ ls
one two
[22:11] drbrain@asx:~/ruby/tmp$ ruby -e ‘File.delete(Dir[""])’
[22:12] drbrain@asx:~/ruby/tmp$ ls
[22:12] drbrain@asx:~/ruby/tmp$
···
Kurt Euler (keuler@portal.com) wrote:
All-
What Ruby command will delete all files within a directory. (I’m using Ruby on Windows.)
I’m trying to delete all files within the directory “output”, which is itself in the current directory.
I’ve tried various lines looking like this:
File.delete(“./output/*”)
But I keep getting “Invalid arguement” or “permission denied” errors.
–
Eric Hodel - drbrain@segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04