Connecting Tech Pros Worldwide Help | Site Map

Find the ID file in Directory

gdjsmith@gmail.com
Guest
 
Posts: n/a
#1: Mar 14 '06
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?

mlimber
Guest
 
Posts: n/a
#2: Mar 14 '06

re: Find the ID file in Directory


gdjsmith@gmail.com wrote:[color=blue]
> 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?[/color]

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-lit...t.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

gdjsmith@gmail.com
Guest
 
Posts: n/a
#3: Mar 14 '06

re: Find the ID file in Directory


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

Phlip
Guest
 
Posts: n/a
#4: Mar 14 '06

re: Find the ID file in Directory


gdjsmith@gmail.com wrote:
[color=blue]
> I don't know the name only the extension...
> Thanks though..[/color]

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.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Closed Thread