on May 25th, 2016, 11:13am, Hans wrote:After writing to a file and closing it, I try to rename that file with "NAME". This often fails, but not always. |
|
You may find that this has something to do with your virus scanner (assuming you have one) rather than Windows itself. Such programs often monitor file creation, so that they can scan each new file as soon as it appears; that may have the effect of 'locking' the file for a short while.
As you can guess, the NAME statement in LBB simply calls the Windows MoveFile API. Indeed this one-line program:
Code:
gets translated to this in LBB, as you can see by selecting 'Show LBB pane' in the Options menu:
Code:SYS "MoveFile", a$, b$ TO R%
Richard.