drive | Extension socket number |
*work | Work buffer (512 bytes) |
BUD_ERR_OK | Processing request was received | |
BUD_ERR_BUSY | Busy - request could not be accepted |
The following values can be designated for "drive" that specifies extension sockets.
BUD_DRIVE_A1 | Extension socket 1 on board A |
BUD_DRIVE_A2 | Extension socket 2 on board A |
BUD_DRIVE_B1 | Extension socket 1 on board B |
BUD_DRIVE_B2 | Extension socket 2 on board B |
BUD_DRIVE_C1 | Extension socket 1 on board C |
BUD_DRIVE_C2 | Extension socket 2 on board C |
BUD_DRIVE_D1 | Extension socket 1 on board D |
BUD_DRIVE_D2 | Extension socket 2 on board D |
Set aside 512 bytes as workspace for the argument *work.
Use this function when you have enough free space to save an executable file, but cannot reserve a block of free space large enough to save the file.
Sint32 ret; Uint32 DefragWork[512 / sizeof(Uint32)]; ret = buDefragDisk(BUD_DRIVE_A1, DefragWork); if (ret != BUD_ERR_OK) return NG; while (buStat(BUD_DRIVE_A1) == BUD_STAT_BUSY) { } if (buGetLastError(BUD_DRIVE_A1) != BUD_ERR_OK) return NG; return OK;
If the memory card is removed while this function is being executed, in most cases all data will be lost. Under no circumstances insert or remove a memory card while this function is being executed for an application program.