| | |
Visual c++ libraries
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2004
Posts: 3
Reputation:
Solved Threads: 0
Hi, just wanna ask if c++ opendir,readdir and closedir code can be implemented in visual c++, i have resently started using this complier and dunno what libraries have changed and if some of these sentences are still valid, and if u can recommend me some kind of "migrating c++ to visual c++" tutorial ill really apreciate it
i would assume if it is MSC++ to MSVC++ then the libraries would be the same? if not there is a brilliant fstream tutorial in the c/c++ tutorials forum that - from the names of the functions - sounds like it could be used to do the same thing; and of course fstream is part of the ANSI standard (ie all compilers support it)
http://sales.carina-e.com
no www
no nonsense
coming soon to a pc near you! :cool:
no www
no nonsense
coming soon to a pc near you! :cool:
•
•
Join Date: Dec 2004
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by Narue
>just wanna ask if c++ opendir,readdir and closedir code can be implemented in visual c++
They're not supported by the library, but you can write versions of them if you really want to using FindFirstFile and FindNextFile.
>if u can post the names of that kind of functions
Are you blind? I gave you the two functions that you need to do what you want to do, whether it's faking POSIX functions, or solving your problem with the straight Windows functions. Now go to MSDN and do the research on them. And in case you missed it the first two times:
FindFirstFile and FindNextFile
Geez.
Are you blind? I gave you the two functions that you need to do what you want to do, whether it's faking POSIX functions, or solving your problem with the straight Windows functions. Now go to MSDN and do the research on them. And in case you missed it the first two times:
FindFirstFile and FindNextFile
Geez.
I'm here to prove you wrong.
I know this is very old code from the attic and dusted off a little. It might give you a hint or confuse you totally.
[php]
// read the filenames from a given directory
// globals
#define MAXFILES 1500 // maximum filenames in buffer
char fbuf[MAXFILES][80]; // filename buffer
int fbntotal; // total number of filenames in buffer
struct {
char reserved[21];
char attribute;
int time;
int date;
long size;
char name[13];
} dirdata; // structure for directory info
...
// read the files in the directory specified in path
// needs full pathname consisting of drive, path and dirname
// reads filenames into a global buffer
void fs_readdir(char *path)
{
int k, done;
done = findfirst(path,&dirdata,0);
for (k = 0; !done; k++)
{
sprintf(fbuf[k],"%s",dirdata.name);
done = findnext(&dirdata);
if (k >= MAXFILES)
break;
}
fbntotal = k; // total entries in filename buffer
}
[/php]
[php]
// read the filenames from a given directory
// globals
#define MAXFILES 1500 // maximum filenames in buffer
char fbuf[MAXFILES][80]; // filename buffer
int fbntotal; // total number of filenames in buffer
struct {
char reserved[21];
char attribute;
int time;
int date;
long size;
char name[13];
} dirdata; // structure for directory info
...
// read the files in the directory specified in path
// needs full pathname consisting of drive, path and dirname
// reads filenames into a global buffer
void fs_readdir(char *path)
{
int k, done;
done = findfirst(path,&dirdata,0);
for (k = 0; !done; k++)
{
sprintf(fbuf[k],"%s",dirdata.name);
done = findnext(&dirdata);
if (k >= MAXFILES)
break;
}
fbntotal = k; // total entries in filename buffer
}
[/php]
May 'the Google' be with you!
![]() |
Similar Threads
- The Hello World server/client program (C++)
- Debug assertion failed (C++)
- Visual C++ 08 Express compiling issues... (C++)
- Creating an OS in visual basic 6.0 (Visual Basic 4 / 5 / 6)
Other Threads in the C++ Forum
- Previous Thread: Desiging a set of rules for a match
- Next Thread: newbie needs help, basic mfc stuff
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






