Problems with Write to File in WIndows?
Bob Sneidar
bobsneidar at iotecdigital.com
Wed Mar 5 17:46:34 EST 2025
Hi all.
I am having a serious issue here with Write to file. I have this snippet of code running in a repeat loop in Windows.
-- if no errors then write file to disk
if pDataA [tKey] ["message"] is empty then
open file tFullPath for binary write
write tFileData to file tFullPath
put the result into tResult
close file tFullPath
wait 100 milliseconds with messages
if not there is a file tFullpath then \
breakpoint
if tResult is empty then
put "SUCCESS! File transferred." into pDataA [tKey] ["message"]
put tFilePath into pDataA [tKey] ["rfafilepath"]
else
put true into pDataA ["error"]
put tResult into pDataA [tKey] ["message"]
end if
else
breakpoint
end if
The code never breaks at the breakpoints, but if I go back and look for the files, only the folders exist, NOT the files I wrote! Note that I check for the existence of the file and breakpoint if it doesn’t exist, and it doesn’t break, meaning the file exists, but it isn’t there!
The crazy thing is if I go back through the same set of files and step through the code in the loop ALL THE FILES END UP BEING SAVED!!!!!
Is there some kind of timing issue here?????
Bob S
More information about the use-livecode
mailing list