drive | Extended socket number |
*fname | Address that gets file name |
BUD_ERR_OK | Normal end | |
BUD_ERR_FILE_NOT_FOUND | File not found | |
BUD_ERR_UNFORMAT | Disk is not formatted | |
BUD_ERR_NO_DISK | No memory card found | |
BUD_ERR_BUSY | A TYPE_B function is being processed |
The following values can be designated for the argument drive that specifies extended sockets.
BUD_DRIVE_A1 | Extended socket 1 on board A |
BUD_DRIVE_A2 | Extended socket 2 on board A |
BUD_DRIVE_B1 | Extended socket 1 on board B |
BUD_DRIVE_B2 | Extended socket 2 on board B |
BUD_DRIVE_C1 | Extended socket 1 on board C |
BUD_DRIVE_C2 | Extended socket 2 on board C |
BUD_DRIVE_D1 | Extended socket 1 on board D |
BUD_DRIVE_D2 | Extended socket 2 on board D |
Normally, this function is used in combination with buFindFistFile() function to get the names of all files in a drive.
Sint32 ret, files, blocks, totel; char fname[16]; BUS_FILEINFO info; files = blocks = total = 0; /* Get name of first file */ ret = buFindFirstFile(drive, fname); if (ret < 0) { if (ret == BUD_ERR_FILE_NOT_FOUND) goto end; else goto err; } if (buGetFileInfo(drive, fname, &info) < 0) goto err; blocks = info.blocks; total += blocks; files++; do { printf("%12s %10d bytes(%3d blocks)\n", files, blocks * 512, blocks); /* Get name of second and subsequent files */ ret = buFindNextFile(drive, fname); if (ret < 0) { if (ret == BUD_ERR_FILE_NOT_FOUND) goto end; else goto err; } if (buGetFileInfo(drive, fname, &info) < 0) goto err; blocks = info.blocks; total += blocks; files++; } while (files < FILE_MAX); end: return OK; err: return NG;