in reply to Close command not being honored
On Windows, you cannot delete, rename or do much of anything with a file if a filehandle to that file is open.
In your first line of code, you open a filehandle to your tempfile when calling
my ($fh, $filename) = tempfile( DIR => $self->{Temp_Dir} );
You then never close $fh, which makes Windows deny your request to delete $filename.
Simply close the filehandle if you only want the name.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Close command not being honored (FILE_SHARE_DELETE)
by tye (Sage) on Feb 22, 2014 at 01:34 UTC | |
|
Re^2: Close command not being honored
by velocitygirl13 (Novice) on Feb 21, 2014 at 15:50 UTC | |
by Corion (Patriarch) on Feb 21, 2014 at 16:01 UTC | |
by velocitygirl13 (Novice) on Feb 21, 2014 at 16:17 UTC | |
by velocitygirl13 (Novice) on Feb 28, 2014 at 15:09 UTC |