Yeah, that's what I'm doing, but you don't even have to use the IF statement. VFP throws no error if the file doesn't exist. I was just hoping someone would know why this is happening. Thanks for the reply.
>This must be some glitch between VFP and Windows ...
>How about good old
>.
>If file(x)
> delete x
>endif
>.
>instead of overwriting ?
>
>
>
>>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.
>>
>>Russell Campbell