reactos/rosapps/smartpdf/baseutils/test_file_util.cpp
Klemens Friedl 435a566751 SmartPDF - lightweight pdf viewer app for rosapps
* sumatrapdf - vendor import
* everything compiles (libjpeg, poppler, fitz, sumatrapdf)
* does NOT link

(remove the comment tags in the parent directory.rbuild file (rosapps dir) to build it)

svn path=/trunk/; revision=29295
2007-09-29 08:39:35 +00:00

30 lines
900 B
C++

/* Written by Krzysztof Kowalczyk (http://blog.kowalczyk.info)
The author disclaims copyright to this source code. */
#include "base_util.h"
#include "file_util.h"
#define DIR_TO_READ "."
int main(int argc, char **argv)
{
FileList* fileList = FileList_Get(DIR_TO_READ, NULL);
if (!fileList) {
printf("Couldn't read dir %s\n", DIR_TO_READ);
goto Exit;
}
FileInfo* fileInfo = fileList->first;
while (fileInfo) {
if (FileInfo_IsDir(fileInfo)) {
printf("d: %s, %s, %d\n", fileInfo->name, fileInfo->path, (int)fileInfo->size);
} else if (FileInfo_IsFile(fileInfo)) {
printf("f: %s, %s, %d\n", fileInfo->name, fileInfo->path, (int)fileInfo->size);
} else {
printf("Unknown type: %s\n", fileInfo->name);
}
fileInfo = fileInfo->next;
}
Exit:
FileList_Delete(fileList);
return 0;
}