in reply to Re: Deleting files in the first folder
in thread Deleting files in the first folder

GrandFather, your code is doing the same as my code. It does not delete the files from the test folder. Thanks for cleaning up the code! could you please help with the deletion of files in the test folder. Owais
  • Comment on Re^2: Deleting files in the first folder

Replies are listed 'Best First'.
Re^3: Deleting files in the first folder
by GrandFather (Saint) on May 10, 2011 at 20:15 UTC

    Heh! That's where the "untested" bit comes in, and without testing I suspect the fix is to change the two unlink lines:

    unlink map {"C:\\Perl\\compress\\$_"} @compressFiles; #delete +compressed files unlink map {"C:\\Perl\\test\\$_"} @testFiles; #delete +test files

    readdir doesn't generate full paths so unless the current directory happens to be the directory containing the files to be deleted, the unlink will fail. The map generates the full path to each file to be deleted.

    True laziness is hard work