PDA

View Full Version : Error in CJPro ? Look at this code


Cali
11-27-2000, 05:14 AM
Hi Banzai,

just had a look at your code in cjproin.cgi

Is this correct?

open (calctime,"$cgipath/datafiles/calctime.dat");
if ($flock) {
flock (calctime,2);
seek (cacltime,0,0);
}
$calctime = <calctime>;
close (calctime);
chomp ($calctime);

look at the seek statement 'cacltime'???

From you CJPro 1.00 package just downloaded.

Coke
11-27-2000, 06:40 AM
That doesn't matter since the new file's file-pointer is at the beginning after opening anyway.

Banzai
11-27-2000, 01:18 PM
When using file locking on a windows server when two instances of a program are attempting to use a file at the same time the pointer is not always set correctly when the first instance is done and the second instance attempts to use the file, or so ive been told, hence the seek statement in the code.

richard
11-27-2000, 02:43 PM
Banzai, Cali was pointing out a typo error, and Gernot explained why it would not (perhaps on *nix make a difference)

Banzai
11-30-2000, 02:01 AM
mmmm.....

didnt see that, but I do now. Wont make a difference anyway.