The objective of the current application is to compare a "new" file with many others to see if it is unique. Running the script hours on end, opens different files to test against thousands of times. Randomly, every other day or less often, the script stops with a error. Today I managed to recover.
/WDMYCLOUD/my/zobrist/Data/step3a/variant_826RHG.txt ADDED as //WDMYCLOUD/my/zobrist/towers/tower_k3fya.txt * * *
Warning: fopen(//WDMYCLOUD/my/zobrist/towers/tower_k3apw.txt): Failed to open stream: Invalid argument in C:\xampp\htdocs\zobrist\duplicate.php on line 30
duplicate #30a: //WDMYCLOUD/my/zobrist/towers/tower_k3apw.txt
//WDMYCLOUD/my/zobrist/Data/step3a/variant_826RHH.txt ADDED as //WDMYCLOUD/my/zobrist/towers/tower_k3fyb.txt * * *
The first and last lines above are normal output from elsewhere.
The related code is:
![Image](http://www.knob.com/cakes/Tcode1.gif)
Code lines #24-28 check that $dir2 and $test_name point to a valid file. The <fopen> on line #30 generated the Warning: this time, BUT after a 5 second delay the similar line #35 worked fine and the script continued to line #44.
Within the error condition the routine towers_added() tries to save the current state to aid recovery.
I'm using Windows 11, FireFox, both current. Locally have XAMMP installed for PHP & mySQL, again current. The //WDMYCLOUD/ is a 6TB hard drive on my LAN. In the PHP.ini file I have increased the "default_socket_timeout" from 60 seconds to 120 with no effect.
Before adding the <sleep(5)> etc., with a Warning the script would go directly to the towers_added() routine, the first <fopen()> in the routine would also create a Warning and then crash when trying to writing to a file. Any ideas? Or am I just stressing Windows with thousands of file operations?