|
-
September 29th, 2005, 09:20 AM
#1
Closing file problems
Hey Guys,
I open a file for "Input As" and then close it.
After that open the same file for "Append As"but then I got an error, that the file is still in use or allready open.
Is there a solution to close the file quicker?
This is what I use now:
f = "C:\test.dat"
i = FreeFile
Open f For Input As #i
Close #i
f= "C:\test.dat"
i2 = FreeFile
Open f For Append As #i2
Close #i2
Thanks allready
Give up your guns and face the law!!
-
September 29th, 2005, 11:27 AM
#2
Re: Closing file problems
Set the initial Open command to be shared access. This way it shouldn't matter if the file is already opened you will still be able to do your append operation later.
Code:
Open f For Input Shared As #i
Death is life's special way of telling you you're fired.
For I do not seek to understand in order to believe, but I believe in order to understand. For I believe this: unless I believe, I will not understand. - Anselm of Canterbury (1033–1109)
-
September 29th, 2005, 02:24 PM
#3
Re: Closing file problems
You can Open for Append when creating files too, so if you will be opening the file again immediately afterward anyway, you might just open it once with Append.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|