Connecting Tech Pros Worldwide Help | Site Map

Find the ID file in Directory

  #1  
Old March 14th, 2006, 06:55 PM
gdjsmith@gmail.com
Guest
 
Posts: n/a
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

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

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 2.0 Label with C# and Textfile html code in Visual Web Developer Express 2005 cnixuser answers 1 October 16th, 2007 04:56 AM
Reading - Parsing Records From An LDAP LDIF File In .Net? Jean-Marie Vaneskahian answers 2 June 9th, 2006 09:05 PM
Cannot use mail() in IE, only works in a debugger--help baustin75@gmail.com answers 8 October 5th, 2005 06:15 PM
Default file in subdirectories Günther Steinmetz answers 7 July 20th, 2005 05:45 PM