>I have a weird situation where I'm generating some text files and VFP tells me the file name is an invalid path/filename. What's weird about it is that I know it's valid because it will generate the file with no problem, but after a few times it suddenly gives me this error. The file path and file name have not changed one iota and SAFETY is OFF, however VFP will start throwing an error instead of just overwriting the file. And the file is not open elsewhere. I can't figure out why it would do this 3 or 4 times and then suddenly decide there's a problem. I think I've run into this in the past and just had to delete the file before recreating it, but this should not be happening.Right, it shouldn't be happening.
Look at it logically. Start excluding all the possible causes as you already did with some.
Filename and path do not change yet it doesn;t work after a while. It is either permissions, file in use somewhere or Windows does not like the file name (illegal name).
Enclose the file write in a TRY..CATCH and when it fails show a messagebox or something with the actual path and file being written including all characters and spacing. See what is it *really* trying to write.
HTH