PHP Problem : filesize() return 0 with file containing few data?

后端 未结 3 1216
闹比i
闹比i 2021-01-18 06:14

I use PHP to call a Java command then forward its result into a file called result.txt. For ex, the file contains this: \"Result is : 5.0\" but the function filesize() retur

3条回答
  •  不知归路
    2021-01-18 06:48

    You say:

    I use PHP to call a Java command then forward its result into a file called result.txt.

    Who does the result writing?

    1.The JAVA programm?

    2.Do you catch the output in PHP and write it to the file.

    3.Do you just redirect the output from command line?

    If 1 and 3 you might have a delay between when the result is written in the file so, practically, when you read the file in PHP, if you don't wait for the execution to finish, you read it befor it even was written with the result.

提交回复
热议问题