Skip to main content
gamedev.net
🔒 Locked

Absolute File Path

Started by snowball123 Apr 20, 2002 at 5:46 PM 3 replies 350+ views
Original Post
snowball123
snowball123
Hi, I wondering if there is a function or something to find a file''s absolute path (ex. C:\windows\desktop\myfile.txt ). I''m basically loading a file like this file = fopen ("myfile.txt", "rb"); Is there a way to find the absolute Path from this? Thanks
snowball123
snowball123
Thanks for the Reply

That works but I was hoping it would validate that the file was there (real file) but I guess that just extra work I have to do.


Here is the C Library version

_fullpath (cFullPath, cFile, 256)


Again Thanks
Dean Harding
Dean Harding
To find out if the file exists you can just try to open it, or use GetFileAttributes or something similar.

By the way, there''s really not much point using functions like _fullpath, because it''s not any more portable than GetFullPathName(), which supports unicode better anyway (otherwise you''d have to use _wfullpath or _tfullpath for unicode support...)


codeka.com - Just click it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.