Click to See Complete Forum and Search --> : creating an empty text file...


tFrench
May 20th, 1999, 01:38 PM
i basically just need a quick way to create an empty text file for output in a specified path... i thought that

Open "c:\test.txt" for Output as #1



would create one if the file didn't already exist, but i guess i was wrong...
please let me know if you have any suggestions...

thanks

tom

shahid_anwar
May 22nd, 1999, 11:10 PM
open "text.txt" for output as #1
close

i had checked it created a empty text file named text.txt
it worked for me it should do for u. becarefull if u already have opened a file of same number close it first.
and check if u have file creation permission in specific folder if using Windows NT.
if u re issue above command it will initilize the file. setting its size to 0 bytes.

stfag
May 23rd, 1999, 04:57 AM
If You use the Freefile function and a variable instead of the static #1, you are safer.

Stian

pete
June 15th, 1999, 08:13 AM
this is how i do it and it always works

Open App.Path & "\test.txt" For Binary As #1

app.path is just a property of your program it gets the path that it is running from.

Jan Businger
June 17th, 1999, 03:55 AM
An empty text file can be created simply in Notepad:
you create a new file, leave it empty and save it as test.txt in the folder you want.
Jan