Dear all,
Despite a good few hours of googling, I have been unable to find out
what the standard C++ libraries are for handling directories and getting
a list of the files inside them.
I am using the mingw c++ compiler on a windows machine to write a
console application. system("mkdir blah") calls aren't what I need
because I need return values to check for things going wrong.
It's the sort of thing that's easy if you know the answer, but
impossible if you don't...
Thanks,
Jamie 3 1869
Jamie Vicary wrote: Dear all,
Despite a good few hours of googling, I have been unable to find out what the standard C++ libraries are for handling directories and getting a list of the files inside them.
C++ only has one standard library, and that doesn't provide any
functionality for directory handling.
I am using the mingw c++ compiler on a windows machine to write a console application. system("mkdir blah") calls aren't what I need because I need return values to check for things going wrong.
It's the sort of thing that's easy if you know the answer, but impossible if you don't...
You have to use system-specific functions, or maybe boost helps.
Jamie Vicary posted: Dear all,
Despite a good few hours of googling, I have been unable
to find out what the standard C++ libraries are for handling
directories and getting a list of the files inside them.
I am using the mingw c++ compiler on a windows machine to
write a console application. system("mkdir blah") calls aren't
what I need because I need return values to check for things going
wrong. It's the sort of thing that's easy if you know the
answer, but impossible if you don't...
Thanks,
Jamie
On Windows:
FindFirstFileEx
FindNextFileEx
FindClose
-JKop
"Jamie Vicary" <Xj************ @Xmansf.Xox.Xac .Xuk> wrote in message
news:cf******** **@uns-a.ucl.ac.uk... Dear all,
Despite a good few hours of googling, I have been unable to find out what the standard C++ libraries are for handling directories and getting a list of the files inside them.
I am using the mingw c++ compiler on a windows machine to write a console application. system("mkdir blah") calls aren't what I need because I need return values to check for things going wrong.
It's the sort of thing that's easy if you know the answer, but impossible if you don't...
See http://www.boost.org/libs/filesystem/doc/index.htm for a portable, and
IMHO, the best solution.
Jeff F This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
Authentication set up and it worked just fine. Then I
realized that I needed to have some pages unsecure.
I then created 2 directories. One named Secure and the
other named Public. I placed my web.config file in my
|
by: Heath |
last post by:
I'm dealing with a C# application that monitors changes to the file
system, and need to exclude irrelevent directories, temp directories
for example.
Is there any way to identify such directories, perhaps through
DirectoryInfo or something similar that might give some attribute that
temp, system, hidden, etc directories might be tagged with?
I wanted to write this code to check and ignore such directories
dynamically based on...
|
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 NetAdvantage component suite from Infragistics for my
web applications. When installing they create several virtual
|
by: rn5a |
last post by:
I have a ListBox which should list all the files & directories that
exist in a particular directory. The problem is I can get the ListBox
to list either all the files or all the directories but not the 2 of
them together. This is what I tried:
Sub Page_Load(.....)
Dim dInfo As DirectoryInfo
dInfo = New DirectoryInfo(Server.MapPath(MyDir))
|
by: rn5a |
last post by:
A ListBox lists all the folders & files existing in a directory named
'MyDir' on the server. Assume that the ListBox lists 2 directories -
'Dir1' & 'Dir2' i.e. these 2 directories reside in the 'MyDir'
directory. Both 'Dir1' & 'Dir2' also house sub-directories & files.
Assume that the sub-directory 'Dir1' has 3 directories & 3 files.
When a user comes to a ASPX page for the first time, the ListBox lists
all the directories & files...
| |
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 as "Additional Dependencies" under
Linker-Input options. Since those libraries are also in different directory,
I specified that library path in project as "Additional Library Directories"
under Linker-General options.
This is where I see some...
|
by: WAP |
last post by:
Hi all,
I am struggling to do things such as create directories and run a check to see if certain files are in these directories.
What is the procedure in order to add this functionality to my program. Please excuse me i'm very new at VB.
Thank you.
|
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 part is
easy. The part that I am having trouble with is using the code in a form
and having a Label's Text property update as a new directory or file is
found.
What I keep getting is the work being done before it is shown to the user
via the...
|
by: kellygreer1 |
last post by:
I think I'm not quite understanding something about error handling in
PHP5. I have written some PHP code to index the contents of C drive
on a Windows machine. When it gets to certain special folders (fake
folders) it runs into errors. Directories it can not read from. I
have tried wrapping the code in a Try / Catch and the error still
comes through. What am I missing?
<?php
// Here is the code:
function indexFiles($path, $handle) {
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |