On Tue, Dec 14, 1999 at 12:24:06PM +0200, Eyal Traitel wrote:
yann@ThePLAnet.net wrote:
A small perl script or C code calling ``unlink'' is probalby your best bet.
Can you publish one here ?
It is trivial!
===== cut here #/usr/bin/perl -w # main { $dir = "/some/dir/you/don't/want"; opendir(DIR, $dir) || die(" no such $dir"); while ( defined( $file = readdir(DIR) ) ) { if ( $file =~ /^.$/ || $file =~ /^..$/ ) { next; } unlink( $file ); } } ===== cut here
Will remove all the files in the directory called $dir. Please note that if you use this and fuck up then it's your own fault and yours alone.