Enumerations | |
enum | IoAssignPerms { IOASSIGN_RDWR = 0, IOASSIGN_RDONLY = 1 } |
Permission value for the sceIoAssign function. More... | |
Functions | |
SceUID | sceIoOpen (const char *file, int flags, SceMode mode) |
Open or create a file for reading or writing. | |
SceUID | sceIoOpenAsync (const char *file, int flags, SceMode mode) |
Open or create a file for reading or writing (asynchronous). | |
int | sceIoClose (SceUID fd) |
Delete a descriptor. | |
int | sceIoCloseAsync (SceUID fd) |
Delete a descriptor (asynchronous). | |
int | sceIoRead (SceUID fd, void *data, SceSize size) |
Read input. | |
int | sceIoReadAsync (SceUID fd, void *data, SceSize size) |
Read input (asynchronous). | |
int | sceIoWrite (SceUID fd, const void *data, SceSize size) |
Write output. | |
int | sceIoWriteAsync (SceUID fd, const void *data, SceSize size) |
Write output (asynchronous). | |
SceOff | sceIoLseek (SceUID fd, SceOff offset, int whence) |
Reposition read/write file descriptor offset. | |
int | sceIoLseekAsync (SceUID fd, SceOff offset, int whence) |
Reposition read/write file descriptor offset (asynchronous). | |
int | sceIoLseek32 (SceUID fd, int offset, int whence) |
Reposition read/write file descriptor offset (32bit mode). | |
int | sceIoLseek32Async (SceUID fd, int offset, int whence) |
Reposition read/write file descriptor offset (32bit mode, asynchronous). | |
int | sceIoRemove (const char *file) |
Remove directory entry. | |
int | sceIoMkdir (const char *dir, SceMode mode) |
Make a directory file. | |
int | sceIoRmdir (const char *path) |
Remove a directory file. | |
int | sceIoChdir (const char *path) |
Change the current directory. | |
int | sceIoRename (const char *oldname, const char *newname) |
Change the name of a file. | |
SceUID | sceIoDopen (const char *dirname) |
Open a directory. | |
int | sceIoDread (SceUID fd, SceIoDirent *dir) |
Reads an entry from an opened file descriptor. | |
int | sceIoDclose (SceUID fd) |
Close an opened directory file descriptor. | |
int | sceIoDevctl (const char *dev, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen) |
Send a devctl command to a device. | |
int | sceIoAssign (const char *dev1, const char *dev2, const char *dev3, int mode, void *unk1, long unk2) |
Assigns one IO device to another (I guess). | |
int | sceIoUnassign (const char *dev) |
Unassign an IO device. | |
int | sceIoGetstat (const char *file, SceIoStat *stat) |
Get the status of a file. | |
int | sceIoChstat (const char *file, SceIoStat *stat, int bits) |
Change the status of a file. | |
int | sceIoIoctl (SceUID fd, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen) |
Perform an ioctl on a device. | |
int | sceIoIoctlAsync (SceUID fd, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen) |
Perform an ioctl on a device. | |
int | sceIoSync (const char *device, unsigned int unk) |
Synchronise the file data on the device. | |
int | sceIoWaitAsync (SceUID fd, SceInt64 *res) |
Wait for asyncronous completion. | |
int | sceIoWaitAsyncCB (SceUID fd, SceInt64 *res) |
Wait for asyncronous completion (with callbacks). | |
int | sceIoPollAsync (SceUID fd, SceInt64 *res) |
Poll for asyncronous completion. | |
int | sceIoGetAsyncStat (SceUID fd, int poll, SceInt64 *res) |
Get the asyncronous completion status. | |
int | sceIoCancel (SceUID fd) |
Cancel an asynchronous operation on a file descriptor. | |
int | sceIoGetDevType (SceUID fd) |
Get the device type of the currently opened file descriptor. | |
int | sceIoChangeAsyncPriority (SceUID fd, int pri) |
Change the priority of the asynchronous thread. | |
int | sceIoSetAsyncCallback (SceUID fd, SceUID cb, void *argp) |
Sets a callback for the asynchronous action. |
enum IoAssignPerms |
int sceIoAssign | ( | const char * | dev1, | |
const char * | dev2, | |||
const char * | dev3, | |||
int | mode, | |||
void * | unk1, | |||
long | unk2 | |||
) |
Assigns one IO device to another (I guess).
dev1 | - The device name to assign. | |
dev2 | - The block device to assign from. | |
dev3 | - The filesystem device to mape the block device to dev1 | |
mode | - Read/Write mode. One of IoAssignPerms. | |
unk1 | - Unknown, set to NULL. | |
unk2 | - Unknown, set to 0. |
sceIoUnassign("flash0"); sceIoAssign("flash0", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);
int sceIoCancel | ( | SceUID | fd | ) |
Cancel an asynchronous operation on a file descriptor.
fd | - The file descriptor to perform cancel on. |
int sceIoChangeAsyncPriority | ( | SceUID | fd, | |
int | pri | |||
) |
Change the priority of the asynchronous thread.
fd | - The opened fd on which the priority should be changed. | |
pri | - The priority of the thread. |
int sceIoChdir | ( | const char * | path | ) |
Change the current directory.
path | - The path to change to. |
int sceIoChstat | ( | const char * | file, | |
SceIoStat * | stat, | |||
int | bits | |||
) |
Change the status of a file.
file | - The path to the file. | |
stat | - A pointer to an io_stat_t structure. | |
bits | - Bitmask defining which bits to change. |
int sceIoClose | ( | SceUID | fd | ) |
int sceIoCloseAsync | ( | SceUID | fd | ) |
Delete a descriptor (asynchronous).
fd | - File descriptor to close |
int sceIoDclose | ( | SceUID | fd | ) |
Close an opened directory file descriptor.
fd | - Already opened file descriptor (using sceIoDopen) |
int sceIoDevctl | ( | const char * | dev, | |
unsigned int | cmd, | |||
void * | indata, | |||
int | inlen, | |||
void * | outdata, | |||
int | outlen | |||
) |
Send a devctl command to a device.
sceIoDevctl("ms0:", 0x200000, indata, 4, NULL, NULL);
dev | - String for the device to send the devctl to (e.g. "ms0:") | |
cmd | - The command to send to the device | |
indata | - A data block to send to the device, if NULL sends no data | |
inlen | - Length of indata, if 0 sends no data | |
outdata | - A data block to receive the result of a command, if NULL receives no data | |
outlen | - Length of outdata, if 0 receives no data |
SceUID sceIoDopen | ( | const char * | dirname | ) |
Open a directory.
int dfd; dfd = sceIoDopen("device:/"); if(dfd >= 0) { Do something with the file descriptor }
dirname | - The directory to open for reading. |
int sceIoDread | ( | SceUID | fd, | |
SceIoDirent * | dir | |||
) |
Reads an entry from an opened file descriptor.
fd | - Already opened file descriptor (using sceIoDopen) | |
dir | - Pointer to an io_dirent_t structure to hold the file information |
Get the asyncronous completion status.
fd | - The file descriptor which is current performing an asynchronous action. | |
poll | - If 0 then waits for the status, otherwise it polls the fd. | |
res | - The result of the async action. |
int sceIoGetDevType | ( | SceUID | fd | ) |
Get the device type of the currently opened file descriptor.
fd | - The opened file descriptor. |
int sceIoGetstat | ( | const char * | file, | |
SceIoStat * | stat | |||
) |
Get the status of a file.
file | - The path to the file. | |
stat | - A pointer to an io_stat_t structure. |
int sceIoIoctl | ( | SceUID | fd, | |
unsigned int | cmd, | |||
void * | indata, | |||
int | inlen, | |||
void * | outdata, | |||
int | outlen | |||
) |
Perform an ioctl on a device.
fd | - Opened file descriptor to ioctl to | |
cmd | - The command to send to the device | |
indata | - A data block to send to the device, if NULL sends no data | |
inlen | - Length of indata, if 0 sends no data | |
outdata | - A data block to receive the result of a command, if NULL receives no data | |
outlen | - Length of outdata, if 0 receives no data |
int sceIoIoctlAsync | ( | SceUID | fd, | |
unsigned int | cmd, | |||
void * | indata, | |||
int | inlen, | |||
void * | outdata, | |||
int | outlen | |||
) |
Perform an ioctl on a device.
(asynchronous)
fd | - Opened file descriptor to ioctl to | |
cmd | - The command to send to the device | |
indata | - A data block to send to the device, if NULL sends no data | |
inlen | - Length of indata, if 0 sends no data | |
outdata | - A data block to receive the result of a command, if NULL receives no data | |
outlen | - Length of outdata, if 0 receives no data |
Reposition read/write file descriptor offset.
pos = sceIoLseek(fd, -10, SEEK_END);
fd | - Opened file descriptor with which to seek | |
offset | - Relative offset from the start position given by whence | |
whence | - Set to SEEK_SET to seek from the start of the file, SEEK_CUR seek from the current position and SEEK_END to seek from the end. |
int sceIoLseek32 | ( | SceUID | fd, | |
int | offset, | |||
int | whence | |||
) |
Reposition read/write file descriptor offset (32bit mode).
pos = sceIoLseek32(fd, -10, SEEK_END);
fd | - Opened file descriptor with which to seek | |
offset | - Relative offset from the start position given by whence | |
whence | - Set to SEEK_SET to seek from the start of the file, SEEK_CUR seek from the current position and SEEK_END to seek from the end. |
int sceIoLseek32Async | ( | SceUID | fd, | |
int | offset, | |||
int | whence | |||
) |
Reposition read/write file descriptor offset (32bit mode, asynchronous).
fd | - Opened file descriptor with which to seek | |
offset | - Relative offset from the start position given by whence | |
whence | - Set to SEEK_SET to seek from the start of the file, SEEK_CUR seek from the current position and SEEK_END to seek from the end. |
Reposition read/write file descriptor offset (asynchronous).
fd | - Opened file descriptor with which to seek | |
offset | - Relative offset from the start position given by whence | |
whence | - Set to SEEK_SET to seek from the start of the file, SEEK_CUR seek from the current position and SEEK_END to seek from the end. |
int sceIoMkdir | ( | const char * | dir, | |
SceMode | mode | |||
) |
Make a directory file.
dir | ||
mode | - Access mode. |
Open or create a file for reading or writing.
if(!(fd = sceIoOpen("device:/path/to/file", O_RDONLY, 0777)) { // error }
if(!(fd = sceIoOpen("device:/path/to/file", O_WRONLY|O_CREAT, 0777)) { // error }
file | - Pointer to a string holding the name of the file to open | |
flags | - Libc styled flags that are or'ed together | |
mode | - File access mode. |
Open or create a file for reading or writing (asynchronous).
file | - Pointer to a string holding the name of the file to open | |
flags | - Libc styled flags that are or'ed together | |
mode | - File access mode. |
Poll for asyncronous completion.
fd | - The file descriptor which is current performing an asynchronous action. | |
res | - The result of the async action. |
Read input.
bytes_read = sceIoRead(fd, data, 100);
fd | - Opened file descriptor to read from | |
data | - Pointer to the buffer where the read data will be placed | |
size | - Size of the read in bytes |
Read input (asynchronous).
bytes_read = sceIoRead(fd, data, 100);
fd | - Opened file descriptor to read from | |
data | - Pointer to the buffer where the read data will be placed | |
size | - Size of the read in bytes |
int sceIoRemove | ( | const char * | file | ) |
Remove directory entry.
file | - Path to the file to remove |
int sceIoRename | ( | const char * | oldname, | |
const char * | newname | |||
) |
Change the name of a file.
oldname | - The old filename | |
newname | - The new filename |
int sceIoRmdir | ( | const char * | path | ) |
Remove a directory file.
path | - Removes a directory file pointed by the string path |
Sets a callback for the asynchronous action.
fd | - The filedescriptor currently performing an asynchronous action. | |
cb | - The UID of the callback created with sceKernelCreateCallback | |
argp | - Pointer to an argument to pass to the callback. |
int sceIoSync | ( | const char * | device, | |
unsigned int | unk | |||
) |
Synchronise the file data on the device.
device | - The device to synchronise (e.g. msfat0:) | |
unk | - Unknown |
int sceIoUnassign | ( | const char * | dev | ) |
Unassign an IO device.
dev | - The device to unassign. |
Wait for asyncronous completion.
fd | - The file descriptor which is current performing an asynchronous action. | |
res | - The result of the async action. |
Wait for asyncronous completion (with callbacks).
fd | - The file descriptor which is current performing an asynchronous action. | |
res | - The result of the async action. |
Write output.
bytes_written = sceIoWrite(fd, data, 100);
fd | - Opened file descriptor to write to | |
data | - Pointer to the data to write | |
size | - Size of data to write |
Write output (asynchronous).
fd | - Opened file descriptor to write to | |
data | - Pointer to the data to write | |
size | - Size of data to write |