%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
#include <assert.h> #include <dirent.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { DIR* dir; struct dirent* entry; char* platform; int cnt; int has_d_type; platform = getenv("NODE_PLATFORM"); assert(platform != NULL); has_d_type = (0 != strcmp(platform, "aix") && 0 != strcmp(platform, "sunos")); dir = opendir("/sandbox"); assert(dir != NULL); cnt = 0; errno = 0; while (NULL != (entry = readdir(dir))) { if (strcmp(entry->d_name, "input.txt") == 0 || strcmp(entry->d_name, "input2.txt") == 0 || strcmp(entry->d_name, "notadir") == 0) { if (has_d_type) { assert(entry->d_type == DT_REG); } else { assert(entry->d_type == DT_UNKNOWN); } } else if (strcmp(entry->d_name, "subdir") == 0) { if (has_d_type) { assert(entry->d_type == DT_DIR); } else { assert(entry->d_type == DT_UNKNOWN); } } else { assert("unexpected file"); } cnt++; } assert(errno == 0); assert(cnt == 4); closedir(dir); return 0; }