|
Posted by £ukasz Hejnak on 09/28/29 11:32
Hello again, some extra info on my case:
the fwrite is completely fine, when fopen is in 'a' mode!
Thus leading to a temporary workaround like this:
$file = "/wwwroot/file"
$countt = explode(".", fread(fopen($file,"r"), filesize($file)));
$count=$countt[1];
$count++;
$handle=fopen($file,"a");
ftruncate($handle, 1);
fwrite($handle,$file);
fclose($handle);
Now having a file with content in the form:
..15
makes it possible to use the above as a workaround..
but still I need to find out what's the problem here. The counter isn't
exactly the only thing I use fwrite for..
The clue I got is, non-empty files are ok to be written in (appended),
empty on the other hand, are totaly uncool for that.
So using a ftruncate($handle,0); is just as I'd use fopen($file,"w");
(gives the same result).
--
Best wishes
Still hoping for Your help
Εukasz Hejnak
Navigation:
[Reply to this message]
|