slam666 Posted May 18, 2005 Share Posted May 18, 2005 Hi, I have a script that add text to a file, the problem I have is the text I put in the file is not writen to the file directly, it seem that Autoit use a buffer and after x number of bytes it write the content to the file. Is there any way to force the buffer to flush to the file? I open the file then my script do stuff, write text in the file, do stuff etc. If I check the file when the script is running I dont see all the text that the script put into it, if I close the script then the rest of the text in the file gets there. Thanks. Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted May 18, 2005 Share Posted May 18, 2005 A filehandle can only read or write. If you do not use a filehandle however, fwrites should take place immediately Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
slam666 Posted May 18, 2005 Author Share Posted May 18, 2005 So if I use a filehandle for write it does write immediately. And there is no way to force it to write immediately? I know that filehandle is faster because it does not open the file each time so I would like to use handle if possible but I need a way to force the buffer to flush.A filehandle can only read or write. If you do not use a filehandle however, fwrites should take place immediately<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted May 18, 2005 Share Posted May 18, 2005 I don't work too much with files, except for data logging of Run() commands... The only way I can think of forcing a handle to push text to the file is to close the handle... If you're not writing too much to the file, I wouldn't see using filenames as a problem, else you might want to see if using multiple handles to the same file would work...i've never tried that...but you never know Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now