Simple rename file problem
Posted: Tue Mar 11, 2008 3:03 pm
I hope this isn't something stupid I overlooked.
I am renaming image[integer].jpg cam capture files using
$begRead and $endRead values are actually coming from another function that is determining the first number and the last number of the range of numbers that need to be renamed. The range of numbers is based on a 24 hour double digit time down to the second so the values are anywhere from 10000 to 240000 more or less as I trim the hour positions that start with 0. I hard coded $begRead and $endRead to debug.
It bombs if $endRead is larger than 37663. Is this some sort of PHP integer limit or a connection timeout limit? It doesn't appear to be a timeout problem as I tried
$begRead=240000;
$endRead=245000;
with the same resutls. I thought maybe PHP needed dos 8+3 file naming but that wasn't it either.
Anyone know?
Thanks in advance if you do!
I am renaming image[integer].jpg cam capture files using
Code: Select all
$startingWrite=0;
$begRead=0;
$endRead=240000;
for ($i=$startingWrite,$inc=0;$inc<($endRead+1);$i++,$inc++) {
$IMAGE_SOURCE = ("image".$begRead.$inc).".jpg";
if (!fopen($IMAGE_SOURCE,"rb"))
$i--;
else {
$OUTPUT_FILE = "image".$i.".jpg";
rename($IMAGE_SOURCE, $OUTPUT_FILE);
}
}
It bombs if $endRead is larger than 37663. Is this some sort of PHP integer limit or a connection timeout limit? It doesn't appear to be a timeout problem as I tried
$begRead=240000;
$endRead=245000;
with the same resutls. I thought maybe PHP needed dos 8+3 file naming but that wasn't it either.
Anyone know?
Thanks in advance if you do!