Subject: | Win32-UTCFileTime: too many files open |
Date: | Mon, 24 Jan 2011 21:58:20 -0800 |
To: | bug-Win32-UTCFileTime [...] rt.cpan.org |
From: | Cully Larson <cully.larson [...] gmail.com> |
Hey,
I have a program that resizes and exports a bunch of photos to a website.
The mtime stamp of the photo is significant (for syncing purposes). So, I
use stat() to get the original mtime of the photo, and then, after resized,
utime() to set it. The scripts runs on Windows, so I was using
the Win32-UTCFileTime library to make sure I'm getting UTC stamps. This
script will resizes thousands of photos.
After I started using the Win32-UTCFileTime library, I started getting an
error when opening the photo files (after resizing a little over 2000
photos). I looked into it and realized that my version of Windows limits
open files to a little over 2000 (a script that have that many open). I
hunted around the script, making sure that all of my files
were explicitly closed. They were. On a hunch, I commented out the use
Win32-UTCFileTime line, and the script ran fine.
So, my assumption here is that Win32-UTCFileTime (stat or utime) doesn't
close the files it opens.
Let me know if you have any questions.
I'm running this with the latest versions of ActivePerl
and Win32-UTCFileTime, on Windows Server 2003.
Cully