473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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?

Mar 14 '06 #1
3 1737
gd******@gmail.com wrote:
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-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

Mar 14 '06 #2
I don't know the name only the extension...
Thanks though..

Mar 14 '06 #3
gd******@gmail.com wrote:
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.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Mar 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Greg Yasko | last post by:
Hi. Does anyone know if there's an equivalent of Perl's file::find module in Python? It traverses a directory. I've googled extensively and checked this newsgroup and can't find anything like it...
1
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
1
by: Thieum22 | last post by:
Hi, I try to go through a directory and it's subdirectories to reah the properties of each files. But I have a problem to set active the directory where the files are, in order to display their...
1
by: Dan Jones | last post by:
I'm writing a script to process a directory tree of images.  In each directory, I need to process each image and generate an HTML file listing all of the images and links to the subdirectories....
0
by: haylow | last post by:
Hi I am new to ASP.NET and am working on an application that runs on a webserver. The user will open up the web interface in a browser on their local machine and enter a path to a directory. I...
0
by: SampathTangudu | last post by:
Hi, We are trying to use the Hash Tables for passing information from one aspx page to another aspx page. We are using the below code. IsolatedStorageFile isoStore =...
0
by: Xah Lee | last post by:
Interactive Find and Replace String Patterns on Multiple Files Xah Lee, 2006-06 Suppose you need to do find and replace of a string pattern, for all files in a directory. However, you do not...
2
by: graphicsxp | last post by:
Hi, How can I open all the files in a directory, which names match a particular string ? Say I have a string like 'a file name to find' and I want to find and open all the files of a given...
6
by: Mudcat | last post by:
Hi, I can't figure out why ctypes won't load the DLL I need to use. I've tried everything I can find (and the ctypes website is down at the moment). Here's what I've seen so far. I've added...
1
by: Calvin Spealman | last post by:
I'm still on 10.4 and I'm trying to build pyOpenSSL, but I'm failing with Python.h trying to include and failing to find any of the shared libraries. I can't figure this one out because i just...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.