PSP2SDK
dirty-f9e4f2d
The free SDK for PSP2
|
Header file which defines file control options. More...
#include <psp2/types.h>
Go to the source code of this file.
Enumerations | |
enum | { PSP2_O_RDONLY = 0x0001, PSP2_O_WRONLY = 0x0002, PSP2_O_RDWR = (PSP2_O_RDONLY | PSP2_O_WRONLY), PSP2_O_NBLOCK = 0x0004, PSP2_O_DIROPEN = 0x0008, PSP2_O_APPEND = 0x0100, PSP2_O_CREAT = 0x0200, PSP2_O_TRUNC = 0x0400, PSP2_O_EXCL = 0x0800, PSP2_O_NOWAIT = 0x8000 } |
enum | { PSP2_SEEK_SET, PSP2_SEEK_CUR, PSP2_SEEK_END } |
Functions | |
SceUID | sceIoOpen (const char *file, int flags, SceMode mode) |
SceUID | sceIoOpenAsync (const char *file, int flags, SceMode mode) |
int | sceIoClose (SceUID fd) |
int | sceIoCloseAsync (SceUID fd) |
int | sceIoRead (SceUID fd, void *data, SceSize size) |
int | sceIoReadAsync (SceUID fd, void *data, SceSize size) |
int | sceIoWrite (SceUID fd, const void *data, SceSize size) |
int | sceIoWriteAsync (SceUID fd, const void *data, SceSize size) |
SceOff | sceIoLseek (SceUID fd, SceOff offset, int whence) |
int | sceIoLseekAsync (SceUID fd, SceOff offset, int whence) |
int | sceIoLseek32 (SceUID fd, int offset, int whence) |
int | sceIoLseek32Async (SceUID fd, int offset, int whence) |
int | sceIoRemove (const char *file) |
int | sceIoRename (const char *oldname, const char *newname) |
int | sceIoSync (const char *device, unsigned int unk) |
int | sceIoWaitAsync (SceUID fd, SceInt64 *res) |
int | sceIoWaitAsyncCB (SceUID fd, SceInt64 *res) |
int | sceIoPollAsync (SceUID fd, SceInt64 *res) |
int | sceIoGetAsyncStat (SceUID fd, int poll, SceInt64 *res) |
int | sceIoCancel (SceUID fd) |
int | sceIoGetDevType (SceUID fd) |
int | sceIoChangeAsyncPriority (SceUID fd, int pri) |
int | sceIoSetAsyncCallback (SceUID fd, SceUID cb, void *argp) |
Header file which defines file control options.
Copyright (C) 2015 PSP2SDK Project
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.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 sceIoClose | ( | SceUID | fd | ) |
int sceIoCloseAsync | ( | SceUID | fd | ) |
Delete a descriptor (asynchronous)
fd | - File descriptor to close |
int sceIoGetAsyncStat | ( | SceUID | fd, |
int | poll, | ||
SceInt64 * | res | ||
) |
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. |
SceOff sceIoLseek | ( | SceUID | fd, |
SceOff | offset, | ||
int | whence | ||
) |
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. |
int sceIoLseekAsync | ( | SceUID | fd, |
SceOff | offset, | ||
int | whence | ||
) |
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. |
Open or create a file for reading or writing
if(!(fd = sceIoOpen("device:/path/to/file", PSP2_O_RDONLY, 0777)) { // error }
if(!(fd = sceIoOpen("device:/path/to/file", PSP2_O_WRONLY|PSP2_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. |
SceUID sceIoOpenAsync | ( | const char * | file, |
int | flags, | ||
SceMode | 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. |
int sceIoPollAsync | ( | SceUID | fd, |
SceInt64 * | res | ||
) |
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 |
int sceIoReadAsync | ( | SceUID | fd, |
void * | data, | ||
SceSize | size | ||
) |
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 sceIoSetAsyncCallback | ( | SceUID | fd, |
SceUID | cb, | ||
void * | argp | ||
) |
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 sceIoWaitAsync | ( | SceUID | fd, |
SceInt64 * | res | ||
) |
Wait for asyncronous completion.
fd | - The file descriptor which is current performing an asynchronous action. |
res | - The result of the async action. |
int sceIoWaitAsyncCB | ( | SceUID | fd, |
SceInt64 * | res | ||
) |
Wait for asyncronous completion (with callbacks).
fd | - The file descriptor which is current performing an asynchronous action. |
res | - The result of the async action. |
int sceIoWrite | ( | SceUID | fd, |
const void * | data, | ||
SceSize | size | ||
) |
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 |
int sceIoWriteAsync | ( | SceUID | fd, |
const void * | data, | ||
SceSize | size | ||
) |
Write output (asynchronous)
fd | - Opened file descriptor to write to |
data | - Pointer to the data to write |
size | - Size of data to write |