Thread: [Dev-C++] Access to filesystem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <at...@su...> - 2003-09-04 11:27:48
|
just doing c++ exercises, while learning, and need to read? or open? all =
files of a directory, but got no idea who to manage it.
while searching the libary, I found the following hits for "filesystem"
regstr.h:
- REGSTR_PATH_FILESYSTEM =
TEXT("System\\CurrentControlSet\\Control\\FileSystem")
- REGSTR_PATH_FILESYSTEM_NOVOLTRACK =
TEXT("System\\CurrentControlSet\\Control\\FileSystem\\NoVolTrack")
- REGSTR_PATH_CDFS =
TEXT("System\\CurrentControlSet\\Control\\FileSystem\\CDFS")
- REGSTR_PATH_CDFS =
TEXT("System\\CurrentControlSet\\Control\\FileSystem\\CDFS")REGSTR_VAL_WI=
N31FILESYSTEM TEXT("Win31FileSystem")
shlobj.h:
- #define SFGAO_FILESYSTEM 0x40000000L
winnt.h:
- #pragma pack(pop)
typedef enum _CM_SERVICE_NODE_TYPE {
DriverType=3DSERVICE_KERNEL_DRIVER,
FileSystemType=3DSERVICE_FILE_SYSTEM_DRIVER,
Win32ServiceOwnProcess=3DSERVICE_WIN32_OWN_PROCESS,
Win32ServiceShareProcess=3DSERVICE_WIN32_SHARE_PROCESS,
AdapterType=3DSERVICE_ADAPTER,
RecognizerType=3DSERVICE_RECOGNIZER_DRIVER
} SERVICE_NODE_TYPE;
and some more in deeper files.
Is this the right way, and if, where will I get informations how to =
handle?
even http://cplus.about.com/library/blcplustut.htm got no hits.
thanx
regards
Achim
|
|
From: P.D. v. Z. <pa...@my...> - 2003-09-04 11:50:04
|
You're probably best off using the Win32 API functions FindFirstFile,
FindNextFile and FindClose... if you don't need portable code
(cross-platform code). Those functions will give you information about
the files matching a certain mask (*.txt for example) in the directory
you specify. You can then use this information to open the files if you
like. If you only need standard information, like the filesize for
example, you don't need to do anything else -- FindFirstFile and
FindNextFile already supply this information (using the WIN32_FIND_DATA
struct).
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of
at...@su...
Sent: Thursday, September 04, 2003 1:29 PM
To: dev...@li...
Subject: [Dev-C++] Access to filesystem
just doing c++ exercises, while learning, and need to read? or open? all
files of a directory, but got no idea who to manage it.
while searching the libary, I found the following hits for "filesystem"
regstr.h:
- REGSTR_PATH_FILESYSTEM
TEXT("System\\CurrentControlSet\\Control\\FileSystem")
- REGSTR_PATH_FILESYSTEM_NOVOLTRACK
TEXT("System\\CurrentControlSet\\Control\\FileSystem\\NoVolTrack")
- REGSTR_PATH_CDFS
TEXT("System\\CurrentControlSet\\Control\\FileSystem\\CDFS")
- REGSTR_PATH_CDFS
TEXT("System\\CurrentControlSet\\Control\\FileSystem\\CDFS")REGSTR_VAL_W
IN31FILESYSTEM TEXT("Win31FileSystem")
shlobj.h:
- #define SFGAO_FILESYSTEM 0x40000000L
winnt.h:
- #pragma pack(pop)
typedef enum _CM_SERVICE_NODE_TYPE {
DriverType=SERVICE_KERNEL_DRIVER,
FileSystemType=SERVICE_FILE_SYSTEM_DRIVER,
Win32ServiceOwnProcess=SERVICE_WIN32_OWN_PROCESS,
Win32ServiceShareProcess=SERVICE_WIN32_SHARE_PROCESS,
AdapterType=SERVICE_ADAPTER,
RecognizerType=SERVICE_RECOGNIZER_DRIVER
} SERVICE_NODE_TYPE;
and some more in deeper files.
Is this the right way, and if, where will I get informations how to
handle?
even http://cplus.about.com/library/blcplustut.htm got no hits.
thanx
regards
Achim
|
|
From: Matthews <dem...@uw...> - 2003-09-05 03:03:38
|
For non-portable, use <io.h>, and _findfirst(), _findnext() and _findclose(). It's not hard to figure out, just save the find handle from _findfirst() in an int to use with _findclose(). At 01:50 PM 04/09/2003 +0200, P.D. van Zelst wrote: >You're probably best off using the Win32 API functions FindFirstFile, >FindNextFile and FindClose... if you don't need portable code >(cross-platform code). Those functions will give you information about >the files matching a certain mask (*.txt for example) in the directory >you specify. You can then use this information to open the files if you >like. If you only need standard information, like the filesize for >example, you don't need to do anything else -- FindFirstFile and >FindNextFile already supply this information (using the WIN32_FIND_DATA >struct). |
|
From: w.y. <yok...@ve...> - 2003-09-05 06:55:47
|
Matthews wrote: > > For non-portable, use <io.h>, and _findfirst(), _findnext() and > _findclose(). It's not hard to figure out, just save the find handle from > _findfirst() in an int to use with _findclose(). Well, there isn't really a portable way to do it since there is no concept of "directories" etc. in standard C and C++ unfortunately. Even if you use the 'boost' libraries it wouldn't work unless someone implemented the platform specific code on your target machine. This is one of the annoying omissions of the standard I wish they would add. |
|
From: Ioannis V. <iv...@em...> - 2003-09-05 15:36:36
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf Of w.y. > Sent: Friday, September 05, 2003 9:55 AM > To: dev...@li... > Subject: Re: [Dev-C++] Access to filesystem > > > Well, there isn't really a portable way to do it since there is no > concept of "directories" etc. in standard C and C++ unfortunately. > > Even if you use the 'boost' libraries it wouldn't work unless > someone implemented the platform specific code on your target > machine. > > This is one of the annoying omissions of the standard I wish they > would add. Actually there are systems where there is not the notion of files or directories. The spirit of the C++98 standard is to be the common subset of abilities of all existing systems. Also the spirit is everything that is provided to be possible to be written with the language itself. That's why directories and files were considered system-specific. The upcoming C++0x standard howwever introduces the notion of availability, that is there will be standard library facilities to be used "where available". So there will be standard library facilities that an implementation may choose to not provide. Also some of them will be "exotic", that is they will not be able to be written with the bare language itself (like network connections). I do not like this notion, I prefer the spirit of C++98. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: Edson T. M. M. <ta...@li...> - 2003-09-05 08:16:57
|
I think a feature greatly missed from Dev-C++ is a context-sensitive
help function, that is, when the user press F1 and the mouse is over a
function call from the standard libraries, it should open a help window
on that function, with the parameters it expect and descriptions (same
thing for types, or for #included headers -- should open a help on that
header, with all classes and methods it implements). It improves coding
speed a lot! Often I remember a function name that I must use, but I
forget the parameter order, or some detail about it.
This documentation, at least for the C language, is freely available
from the gnu texinfo (e.g., on the glibc texinfo). I don't know if there
is something similar for C++.
Is there some plugin out there that implements this feature on Dev-C++?
If not, at least, is there some kind of browser for the C and C++
standard libraries, that can be used along Dev-C++ ?
Thanks in advance,
Edson
|