Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error #75 at Open {file} For Input As #1 (need 2 progs on same PC to communicate)
#9
(05-23-2024, 05:45 PM)Kernelpanic Wrote: One could almost compare it with a traffic light at an intersection: If North - South is green, then West - East has to wait (red) until it itself is green. If all road users stick to it, there won't be crashed.  Wink
Unfortunately Steve's approach can't prevent both programs from reading and writing at the same time, I don't think there's a way to do it with read/write file interactions alone. Both programs can read the `00` at the same time and will simply write over each-other when updating the status. Then you'll have the main program reading the mouse data while the second program is writing it, and it falls apart.

That said an alternative for madscijr's original approach could be to have the mouse program write to a completely separate temporary file and then use `NAME` to rename the file to be the correct one. That has two advantages that 1. There's no period where the file is created but doesn't have the correct contents, and 2. There's no period where the file exists but is open by the mouse program (since the mouse program closes it before renaming). Over in the main program you can have it use `KILL` to delete the file after reading the contents, that would signal to the mouse program that the file is available to be used again.

It's still not as good as a proper IPC approach like using networking or a pipe, but might solve the problem.
Reply


Messages In This Thread
RE: Error #75 at Open {file} For Input As #1 (need 2 progs on same PC to communicate) - by DSMan195276 - 05-23-2024, 06:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mac debugger not connecting, a user error! BlameTroi 0 110 02-07-2026, 06:18 PM
Last Post: BlameTroi
  ERROR MESSAGES COLORS ? aurel 5 399 01-02-2026, 11:26 AM
Last Post: aurel
Question Converting input from other devices to standard PC gamepad analog input? madscijr 0 176 01-01-2026, 06:39 PM
Last Post: madscijr
  Using CONST & _RGB used together seem to error... Dav 12 714 12-12-2025, 12:29 AM
Last Post: Dav
  error doing image collision detection with _MemGet madscijr 55 4,769 10-01-2025, 03:25 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)