Issue 16: run time-error 58 file already exists
Status:  Accepted
Owner:
Project Member Reported by dragon...@gmail.com, May 7, 2008
http://www.daniweb.com/forums/thread11155.html    runtime error#58 


Runtime error 58 occurs when you try to rename a file with a name that
already exists (in the same folder), or you try to save a new file with the
same name as one that already exists (in the same folder).

With MSDOS, sorry Windows you cannot insert information into a file that
already exists. The way around this is to first re-name the old file (so it
is still there if you need it, a temporary file so to speak) with an
obscure name (I use a few relevant "ABC" characters) plus a randomly
generated number) for new name of the "old" file. Then I use a string to
store the new name of the file (so I can still refer to it). Then you save
the new information to the old file name (now you have re-named it, it
won't clash). At this point if it goes wrong you can then re-name the
"backup" file and you will be where you were before. If there is no problem
and the new file is saved then you just delete the temporary file. If you
don't then the folder will become full of the temporary files.
May 7, 2008
Project Member #1 dragon...@gmail.com
(No comment was entered for this change.)
无标题.jpg
119 KB   View   Download