Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 14th, 2006, 06:55 PM
gdjsmith@gmail.com
Guest
 
Posts: n/a
Default Find the ID file in Directory

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?

  #2  
Old March 14th, 2006, 07:05 PM
mlimber
Guest
 
Posts: n/a
Default 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

  #3  
Old March 14th, 2006, 07:05 PM
gdjsmith@gmail.com
Guest
 
Posts: n/a
Default Re: Find the ID file in Directory

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

  #4  
Old March 14th, 2006, 07:15 PM
Phlip
Guest
 
Posts: n/a
Default 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!!!
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles