Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP won't overwrite a file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01142411
Message ID:
01142419
Vues:
8
>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


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform