You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2001/01/23 18:51:03 UTC
cvs commit: apr/file_io/win32 dir.c
wrowe 01/01/23 09:51:02
Modified: file_io/win32 dir.c
Log:
Add a healthy bit of extra native info to win32's apr_dir_read()
Revision Changes Path
1.45 +15 -7 apr/file_io/win32/dir.c
Index: dir.c
===================================================================
RCS file: /home/cvs/apr/file_io/win32/dir.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- dir.c 2001/01/23 04:10:46 1.44
+++ dir.c 2001/01/23 17:50:58 1.45
@@ -200,12 +200,15 @@
}
finfo->name = thedir->n.entry->cFileName;
}
-
- finfo->valid = APR_FINFO_NAME | APR_FINFO_SIZE | APR_FINFO_MTIME;
- finfo->fname = NULL;
- finfo->size = (thedir->n.entry->nFileSizeHigh * MAXDWORD) +
- thedir->n.entry->nFileSizeLow;
- FileTimeToAprTime(&finfo->mtime, &thedir->n.entry->ftLastWriteTime);
+ finfo->cntxt = thedir->cntxt;
+ finfo->valid = APR_FINFO_NAME | APR_FINFO_TYPE | APR_FINFO_CTIME
+ | APR_FINFO_ATIME | APR_FINFO_MTIME | APR_FINFO_SIZE;
+ /* Do the best job we can determining the file type.
+ * Win32 only returns device names in a directory in response to a specific
+ * request (e.g. FindFirstFile("CON"), not to wildcards, so we will ignore
+ * the BLK, CHR, and other oddballs, since they should -not- occur in this
+ * context.
+ */.
if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
finfo->filetype = APR_DIR;
finfo->valid |= APR_FINFO_TYPE;
@@ -215,10 +218,15 @@
finfo->valid |= APR_FINFO_TYPE | APR_FINFO_LINK;
}
else {
- /* XXX: Not good logic. No devices here, but what might we find? */
finfo->filetype = APR_REG;
finfo->valid |= APR_FINFO_TYPE;
}
+ FileTimeToAprTime(&finfo->ctime, &thedir->n.entry->ftCreationTime);
+ FileTimeToAprTime(&finfo->mtime, &thedir->n.entry->ftLastWriteTime);
+ FileTimeToAprTime(&finfo->atime, &thedir->n.entry->ftLastAccessTime);
+ finfo->size = (thedir->n.entry->nFileSizeHigh * MAXDWORD)
+ + thedir->n.entry->nFileSizeLow;
+ finfo->fname = NULL;
return APR_SUCCESS;
}