BartlebyScrivener
Member level 5
- Joined
- Feb 8, 2012
- Messages
- 90
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 2,081
How to tell if a file opened with $fopen("file.txt", "a") is empty
I am outputting my test results to a text file. If it is the first time the tests have been run, I want to add a line, say including the date, to the text file. If it is not the first time the test has been run, then the text file will all ready have info, and I do not want to add this line.
I tried
but that didn't work.
Thanks.
I am outputting my test results to a text file. If it is the first time the tests have been run, I want to add a line, say including the date, to the text file. If it is not the first time the test has been run, then the text file will all ready have info, and I do not want to add this line.
I tried
Code Verilog - [expand] 1 2 3 4 5 filetxt = $fopen("file.txt", "a") if ($feof(filetxt)) begin // date text end
but that didn't work.
Thanks.