in reply to Re: Unlinking...
in thread Unlinking...

I know I put the script in the directory below the PERL directory, that way I could open it with the script and then delete the files. Wheres merlyn when ya need him? ;-]

Well I tried that before but it didn't work...Oh well Ill try it again..

and i get this... Insecure dependency in unlink while running with -T switch at c:\windows\TEMP\DzTemp.pl line 3

Replies are listed 'Best First'.
Re: Re: Re: Unlinking...
by swiftone (Curate) on Nov 22, 2000 at 02:27 UTC
    Your data is tainted :) If you're just trying to delete files, I'd either remove the -T, or use chdir, opendir, readdir, unlink in combo to delete the list of files.
      Ok, can I get a code example for that? because i havent gotten into that stuff in my Perl Bible yet. Thanks, you get ++ for all your help
        It's much like SteveAZ98 did below.

        See the readdir page for most of an example:

        opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!"; @dots = grep { /^\./ && -f "$some_dir/$_" } readdir(DIR); closedir DIR;
        Which we can adapt like:
        opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!"; @files = grep {/\.txt$/} readdir(DIR); closedir DIR; unlink @files;
        Notice that unlink is not related to the directory functions. Also, arturo reminded me that the filesystem is considered untrusted, so this still may not work with Taint checking.