Page 1 of 1

Location

Posted: Sun May 10, 2009 2:18 pm
by izidor
Lets say that i have folder named text and in it there is text.txt.Here is my question how to open file from specific folder without writing "C:\..." or "D:\..."?

Posted: Sun May 10, 2009 3:41 pm
by bongomeno
unless it is in the same folder as the program opening it, the file must have the C:\whatever\.

if the program is trying to access a file within a folder in the programs folder then you can do it like this (assuming your prog is in c:\f\) -

c:\f\folder\file.ext
OR
\folder\file.ext

Posted: Mon May 11, 2009 6:59 am
by izidor
Thanks for reply. When i was searching net i found another solution command CHDIR.

Posted: Wed Jun 17, 2009 11:54 am
by DDastardly71
If the folder is in the same directory as your program, you can use relative instead of absolute path and without using CHDIR.

Works...
OPEN "text\text.txt" FOR INPUT AS #1

Will not work...this is an incomplete path as shown from the previous reply.
OPEN "\text\text.txt" FOR INPUT AS #1