[Tilesathome] tilesathome rmtree issue on Windows

Rob Reid rob at robreid.co.nz
Thu Sep 4 22:06:45 BST 2008


Dirk-Lüder Kreie wrote the following on 05/09/2008 07:23:
> Ed Loach schrieb:
>>> I've made another change to try and confirm this; I'm changing
>>> the
>>> delay to 30 seconds and during that delay I will try and delete
>>> the
>>> file. I've also changed the bit above to:
>>>     my $Image = newFromPng GD::Image($File);
>>>     open(PNG, $File) || die;
>>>     close(PNG);
>>>
>>> I'll test it when (if) the upload queue ever lets me upload the
>>> current result ready to restart the program to try the changed
>>> version.
>> The file is definitely locked after the close line. I can't delete
>> it. With a further test I *can* delete it immediately before the
>> newFromPng line. 
> Then that is either a windows bug, or a bug of your libGD-perl or 
> activeperl/windows.
Sorry I have not commented sooner on this, I have not been following the 
windows threads much since I switched to running in a linux virtual machine.

I did some de-bugging along the same lines some time ago and reached a 
similar conclusion.
Attached below is the email I sent to the maintainer of the Activeperl 
GD module . I received no response.

rcr

    -------- Original Message -------- 

    Subject: 	Possible issue with GD.pm on windows.
    Date: 	Mon, 21 Jan 2008 00:00:18 +1300
    From: 	Rob Reid <rob at robreid.co.nz>
    To: 	lstein at cshl.org



    I'm having a problem on Windows unlinking a file after it has been used 
    in a newfromPng call.

    Perl ver. = ActivePerl 5.8.8 Build 822
    GD ver. = 2.35
    OS = Windows XP SP2

    Sample script :

       use GD;
        
       my $File = "C:/test/test.png";
       open $FileHandle,$File;
       my $Image = newFromPng GD::Image($FileHandle);
       undef $Image;
       close $FileHandle;
       unlink ($File);

    The end result is that test.png is not deleted as I would expect, if I 
    comment out the line with the newFromPng call the file deletes as expected.

    What the script I'm debugging does is process a large number of 
    temporary png files, apply changes to them using GD, output new pngs and 
    then delete the temporary files. For the users running it on linux it 
    cleans up the temporary files but on windows it does not appear to.

    Any ideas?

    Regards

    Rob   






More information about the Tilesathome mailing list