Shinobi Library - Memory Card Function

buSetFileAttr

Changes file attributes

FORMAT

buSetFileAttr( drive, *fname, header, copyflag )
Sint32 drive
const char *fname
Uint16 header
Uint8 copyflag

PARAMETER

 drive  Extension socket number 
 *fname  File name 
 header  Header offset (ignored) 
 copyflag  Copy flag (00H - FFH) 

RETURN

 BUD_ERR_OK  Processing request was accepted 
 BUD_ERR_BUSY  Request could not be accepted because processing was in progress 

DESCRIPTION

Changes the attributes of a specified file in a memory card inserted in a specified extension socket.

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 


EXAMPLE

/* Set "copying prohibited" flag (set copy flag to "FFH") */
buSetFileAttr(BUD_DRIVE_A1, "SAVEFILE_001", 0, 0xff);
if (ret != BUD_ERR_OK) return NG;
while (1) {
	if (buStat(BUD_DRIVE_A1) == BUD_STAT_READY) break;
}
if (buGetLastError(BUD_DRIVE_A1) != BUD_ERR_OK)
	return NG;
return OK;

NOTE

Use this function to change the copy flag for a file that already exists. The header offset is ignored. Specify "0".

** Details of copy flag?


buSetFileAttr
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999