473,386 Members | 1,873 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.

accessing directories using C++

Hello

How can i access the directory structure in C++? (I used to use the DIR
structure in C earlier). is there a specialised way to access
directories in C++?

What my requirement is that i want to list the contents of a directory
similar to the ls command in linux. Please tell me how to go abt doing
this.

Thank you in advance

Jul 23 '05 #1
2 1303
Casanova http://www.prashanthmohan.tk wrote:
Hello

How can i access the directory structure in C++? (I used to use the DIR
structure in C earlier). is there a specialised way to access
directories in C++?

What my requirement is that i want to list the contents of a directory
similar to the ls command in linux. Please tell me how to go abt doing
this.

Thank you in advance


There is no standard library module for interfacing with directory
structures, but there are plenty of good libraries for it. Check out
boost::filesystem, in particular the simple_ls program:

http://www.boost.org/libs/filesystem.../simple_ls.cpp
Jul 23 '05 #2
Casanova http://www.prashanthmohan.tk wrote:
Hello

How can i access the directory structure in C++? (I used to use the DIR
structure in C earlier).

Which is not part of the C standard.

is there a specialised way to access
directories in C++?

You will have to use system-specific facilities for this.

What my requirement is that i want to list the contents of a directory
similar to the ls command in linux. Please tell me how to go abt doing
this.

Check some API documentation on the OS you are going to use.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #3

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

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
2
by: R. Readi | last post by:
Is it possible in UNIX/BSD? Just to give inode instead of path name for accessing files. Thanks, Rodrigo
2
by: Jeffry van de Vuurst | last post by:
Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of you has some ideas about this. I'm using the...
0
by: Dave Friedel | last post by:
I read through the WS2 samples but I am still fuzzy on how to access the settings I need to validate my users passwords. Specifically, I do not know how to tell which hostheader is being accessed...
1
by: homesick123 | last post by:
Hi I am very new to perl.I want to write a script which will access the directories and their sub-directories.For eg. -default ----main -------dir1 ---------- ------------ ...
8
by: supasnail | last post by:
I have a happily working set of asp pages which read from the database via include file "./_private/include/database.mdb". However, when I try to gain access to this database on pages one folder...
6
by: =?Utf-8?B?WW9naSBXYXRjaGVy?= | last post by:
Hello, I am using Visual Studio-2003. I created a project to build my library. Since I am using third party libraries as well, I have specified those additional library dependencies in project...
6
by: Adam McCormack | last post by:
Good morning, I hope I'm not repeating a post, but I did try to search for the topic before asking. I am trying to resolve an issue that has come up as a result of planned migration from a single...
4
by: Edwin Velez | last post by:
http://msdn.microsoft.com/en-us/library/806sc8c5.aspx The URL above gives sample code for use within a Console Application. What I would like to do is use this code within a Windows Form. That...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.