Timer Causes Dropped File Output

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kkleinfelter
Posts: 32
Joined: 21 Dec 2018, 10:59

Timer Causes Dropped File Output

08 May 2020, 14:05

It appears that if a timer fires while a FileAppend is writing to a file on a network shared folder, the I/O does not complete.

How can I ensure the file write gets resumed and run to completion? Do I need to wrap all my calls to FileAppend with "Critical On" and "Critical Off"?

I don't know for CERTAIN it is the timer event causing the FileAppend to intermittently not write the output. What I know for certain is:
* I use timers.
* I use FileAppend to a network shared file.
* Something like 0.01% of my FileAppend don't have any effect.
User avatar
boiler
Posts: 17387
Joined: 21 Dec 2014, 02:44

Re: Timer Causes Dropped File Output

08 May 2020, 14:51

One thing you can do it set a global flag (let's call it Busy) equal to 1 at the beginning of your FileAppend process and set it to 0 at the end. Then have all of your subroutines/functions that are launched by timers check to see if the Busy flag is set, and to not do anything (return from the subroutine or the function) if it is busy.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Timer Causes Dropped File Output

08 May 2020, 15:04

barring ahk bugs, how would a timer subroutine interrupt a fileappend? the fileappend blocks until finished.

post code
just me
Posts: 9574
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Timer Causes Dropped File Output

09 May 2020, 06:12

FileAppend -> Error Handling
[v1.1.04+]: This command is able to throw an exception on failure. For more information, see Runtime Errors.

ErrorLevel is set to 1 if there was a problem or 0 otherwise.

A_LastError is set to the result of the operating system's GetLastError() function.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], mstrauss2021, Spawnova, zephyrus2706 and 354 guests