|
From: sebastien k. <seb...@wa...> - 2004-05-19 11:21:31
|
Thank you Keith for your answer.
What fooled me is that the returned value can look quite strange (like
2306992), and that the first name returned was ".", wich doesn't mean much
to Windows-kids, but reminds us the good'ol DOS days, where every "dir"
command started by those famous "one-dot" and "two-dots" files...
(still there, as one can see it through CMD, but not visible in the Windows
explorer)
Works fine now. The below code seems to work OK:
------------------------------------------------------------
int main()
{
int handle;
struct _finddata_t s;
if( (handle = _findfirst( "*.*", &s )) != -1 )
do {
printf( "attrib=%d\tsize=%d\tname=%s\n", s.attrib, s.size, s.name );
}
while( !_findnext( handle, &s ) );
system("pause");
}
------------------------------------------------------------
Another question, about file attributes. Quote from "io.h":
-----------------------------------------------
#define _A_NORMAL 0x00000000
#define _A_RDONLY 0x00000001
#define _A_HIDDEN 0x00000002
#define _A_SYSTEM 0x00000004
#define _A_VOLID 0x00000008
#define _A_SUBDIR 0x00000010
#define _A_ARCH 0x00000020
-----------------------------------------------
I know what RDONLY, HIDDEN, SUBDIR or SYSTEM are, I presume VOLID stands
for "Volume ID" (didn't know this could be a file ...), but what about ARCH
???
The point is, this is the value I'm getting on files, and I am curious...
Sebastien Kramm
|