2 * Ullrich von Bassewitz, 2012-05-30. Based on code by Groepaz.
14 DIR* __fastcall__ opendir (const char*)
16 unsigned char buf[32];
20 /* Setup file name and offset */
25 /* Open the directory on disk for reading */
26 d.fd = open (d.name, O_RDONLY);
29 /* Skip the disk header */
30 if (_dirread (&d, buf, 32)) {
32 /* Allocate memory for the DIR structure returned */
33 dir = malloc (sizeof (*dir));
35 /* Copy the contents of d */
37 memcpy (dir, &d, sizeof (d));
39 /* Set an appropriate error code */