Find the ID file in Directory

G

gdjsmith

I've read through several threads and found no simple solutions.
I have a Windows XP system.
I will store a file with extension .id in the same folder as the
executable.
I want my application to echo the name of this file.

EXAMPLE:
If I store the file: HelloWord.id in the directory my application will
Echo
HelloWord

Any ideas?
 
M

mlimber

I've read through several threads and found no simple solutions.
I have a Windows XP system.
I will store a file with extension .id in the same folder as the
executable.
I want my application to echo the name of this file.

EXAMPLE:
If I store the file: HelloWord.id in the directory my application will
Echo
HelloWord

Any ideas?

If you know the name and location of the file, you can do it with
standard C++ fstreams. If not, you must resort to an extension that is
specific to your OS and you should post in a newsgroup for your
compiler or OS (see
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9 for some
suggestions). Alternately, you might try the more portable but also
non-standard Boost.Filesystem library
(http://boost.org/libs/filesystem/doc/index.htm).

Cheers! --M
 
P

Phlip

I don't know the name only the extension...
Thanks though..

Look for FindFirstFile in your Windows SDK, or _findfirst in your C RunTime
library. Pass them a "file glob" of "*.id".

And in future, use Google Groups to find the best one for a question. This
one is only qualified to discuss the C++ language itself, not all the
libraries and systems it accesses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top