ID: 22708 User updated by: ron dot petty at unigeek dot com Reported By: ron dot petty at unigeek dot com Status: Open Bug Type: Filesystem function related Operating System: Redhat 8 PHP Version: 4.3.1 New Comment:
I removed the code that reopened the file and did the following instead ... fclose($h6); print filesize("/etc/group.backup")."\n"; print shell_exec("cat /etc/group.backup"); print filesize("/etc/group.backup")."\n"; my output is 0 repett0:x:1102: drechsel:x:1103: dan:x:1104: coty:x:1105: demo:x:1106: 0 I assume fclose means the file is closed and the output is flushed, but it is not in this case (unless I am not seeing something). Previous Comments: ------------------------------------------------------------------------ [2003-03-14 13:14:28] ron dot petty at unigeek dot com This is on the command line, not through a browser. I have wrote some code that reads a file in, modifies it then writes it out to disk. Then the script reads it back in, however the size is 0. If I look at the file on the filesystem it is not zero and is correct. I have tried flush, but that seems to only apply to web based stuff. I am running this on the command line. I do fclose the file from the previous write. I know a work around is to not write anything to the file until its done but this should still work. 1)open file 2)change contents 3)save file 4)open file file size is incorrect 0, filesystem says it is >0 and correct. I have the script, but don't know where to upload it? Thank you. Ron ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22708&edit=1