Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

relative reference to file using partial path?

Status
Not open for further replies.

gacaccia

Technical User
May 15, 2002
258
US
hi all,

i have a function that needs to read the contents of a file. it looks for the file in the current directory, which can vary in name in location. if it doesn't find it, then it needs to look in a sub folder that will always be there with the name pp98. i tried refering to this relative absolute location as ".\\pp98\\file.txt", "..\\pp98\\file.txt", "\\pp98\\file.txt" and "pp98\\file.txt". none of them work.

is there no way to reference the file without specifying a complete path? if i must specify a complete path to get this to work, how to i determine the current location?

thanks,

glenn
 
>> how to i determine the current location?

_getcwd()

-pete
I just can't seem to get back my IntelliSense
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top