A few quick questions: files in folder, and timestamps

Started by
2 comments, last by Structural 21 years, 2 months ago
At the moment I''m working on a console for my error and output viewing and I''d love to output the buffer of the console to a file once a while, since the console is lost when the app closes. I''ve been searching google but it can''t find it. Anyway, for this I want to create a new file every time, but it has to be unique. How can I get the contents of the folder so I can quickly see if a file exists or not? Another question is regarding timestamps: How do I get a timestamp in a dd/mm/yy or hh/mm/ss format? TY ______________________________ "A computer is meant to be a big calculator, not a storage device" Struct.m33p.net
STOP THE PLANET!! I WANT TO GET OFF!!
Advertisement
for Windows it''s

FindFirst

* with the returned handle you can go through the folder by doing FindNext
* don''t use FindClose in WinNT if FindFirst wasn''t successful, could hang up your system

for Dos look into the io.h, there are prototypes like this:
long _RTLENTRY _EXPFUNC _findfirst(char *, struct _finddata_t *);
long _RTLENTRY _EXPFUNC _findnext(long, struct _finddata_t *);
int _RTLENTRY _EXPFUNC _findclose(long);
and so on ...

bye,
andré
quote:Original post by Anonymous Poster
for Windows it''s

FindFirst

* with the returned handle you can go through the folder by doing FindNext
* don''t use FindClose in WinNT if FindFirst wasn''t successful, could hang up your system

for Dos look into the io.h, there are prototypes like this:
long _RTLENTRY _EXPFUNC _findfirst(char *, struct _finddata_t *);
long _RTLENTRY _EXPFUNC _findnext(long, struct _finddata_t *);
int _RTLENTRY _EXPFUNC _findclose(long);
and so on ...

bye,
andré


was it the legendary André LaMothe?!

.lick
well, no i''m just another coder ...

bye,
andré

This topic is closed to new replies.

Advertisement