vitasdk
Documentation of the vitasdk

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceIofilemgr_stub



Functions

SceUID sceIoOpen (const char *file, int flags, SceMode mode)
 Open or create a file for reading or writing. More...
 
int sceIoClose (SceUID fd)
 Delete a descriptor. More...
 
SceSSize sceIoRead (SceUID fd, void *buf, SceSize nbyte)
 Read input. More...
 
int sceIoPread (SceUID fd, void *data, SceSize size, SceOff offset)
 Read input at offset. More...
 
SceSSize sceIoWrite (SceUID fd, const void *buf, SceSize nbyte)
 Write output. More...
 
int sceIoPwrite (SceUID fd, const void *data, SceSize size, SceOff offset)
 Write output at offset. More...
 
SceOff sceIoLseek (SceUID fd, SceOff offset, int whence)
 Reposition read/write file descriptor offset. More...
 
long sceIoLseek32 (SceUID fd, long offset, int whence)
 Reposition read/write file descriptor offset (32bit mode) More...
 
int sceIoRemove (const char *file)
 Remove directory entry. More...
 
int sceIoRename (const char *oldname, const char *newname)
 Change the name of a file. More...
 
int sceIoSync (const char *device, unsigned int unk)
 Synchronize the file data on the device. More...
 
int sceIoSyncByFd (SceUID fd, int flag)
 Synchronize the file data for one file. More...
 
int sceIoCancel (SceUID fd)
 Cancel an asynchronous operation on a file descriptor. More...
 
int sceIoGetPriority (SceUID fd)
 
int sceIoGetProcessDefaultPriority (void)
 
int sceIoGetThreadDefaultPriority (void)
 
int sceIoSetPriority (SceUID fd, int priority)
 
int sceIoSetProcessDefaultPriority (int priority)
 
int sceIoSetThreadDefaultPriority (int priority)
 

Function Documentation

◆ sceIoOpen()

SceUID sceIoOpen ( const char *  file,
int  flags,
SceMode  mode 
)

Open or create a file for reading or writing.

Example1: Open a file for reading
if((fd = sceIoOpen("device:/path/to/file", SCE_O_RDONLY, 0777) < 0) {
// error code in fd, for example no open filehandle left (0x80010018)
}
SceUID sceIoOpen(const char *file, int flags, SceMode mode)
Open or create a file for reading or writing.
@ SCE_O_RDONLY
Read-only.
Definition: iofilemgr.h:29
Example2: Open a file for writing, creating it if it doesn't exist
if((fd = sceIoOpen("device:/path/to/file", SCE_O_WRONLY|SCE_O_CREAT, 0777) < 0) {
// error code in fd, for example no open filehandle left (0x80010018)
}
@ SCE_O_WRONLY
Write-only.
Definition: iofilemgr.h:30
@ SCE_O_CREAT
Create.
Definition: iofilemgr.h:37
Parameters
file- Pointer to a string holding the name of the file to open.
flags- Libc styled flags that are or'ed together (One or more SceIoMode).
mode- One or more SceIoAccessMode flags or'ed together. Can also use Unix absolute permissions.
Returns
> 0 is a valid file handle, < 0 on error.

◆ sceIoClose()

int sceIoClose ( SceUID  fd)

Delete a descriptor.

int sceIoClose(SceUID fd)
Delete a descriptor.
Parameters
fd- File descriptor to close
Returns
< 0 on error

◆ sceIoRead()

SceSSize sceIoRead ( SceUID  fd,
void *  buf,
SceSize  nbyte 
)

Read input.

Example:
bytes_read = sceIoRead(fd, data, 100);
SceSSize sceIoRead(SceUID fd, void *buf, SceSize nbyte)
Read input.
Parameters
fd- Opened file descriptor to read from
buf- Pointer to the buffer where the read data will be placed
nbyte- Size of the read in bytes
Returns
The number of bytes read

◆ sceIoPread()

int sceIoPread ( SceUID  fd,
void *  data,
SceSize  size,
SceOff  offset 
)

Read input at offset.

Example:
bytes_read = sceIoPread(fd, data, 100, 0x1000);
int sceIoPread(SceUID fd, void *data, SceSize size, SceOff offset)
Read input at offset.
Parameters
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
offset- Offset to read
Returns
< 0 on error.

◆ sceIoWrite()

SceSSize sceIoWrite ( SceUID  fd,
const void *  buf,
SceSize  nbyte 
)

Write output.

Example:
bytes_written = sceIoWrite(fd, data, 100);
SceSSize sceIoWrite(SceUID fd, const void *buf, SceSize nbyte)
Write output.
Parameters
fd- Opened file descriptor to write to
buf- Pointer to the data to write
nbyte- Size of data to write
Returns
The number of bytes written

◆ sceIoPwrite()

int sceIoPwrite ( SceUID  fd,
const void *  data,
SceSize  size,
SceOff  offset 
)

Write output at offset.

Example:
bytes_written = sceIoPwrite(fd, data, 100, 0x1000);
int sceIoPwrite(SceUID fd, const void *data, SceSize size, SceOff offset)
Write output at offset.
Parameters
fd- Opened file descriptor to write to
data- Pointer to the data to write
size- Size of data to write
offset- Offset to write
Returns
The number of bytes written

◆ sceIoLseek()

SceOff sceIoLseek ( SceUID  fd,
SceOff  offset,
int  whence 
)

Reposition read/write file descriptor offset.

Example:
pos = sceIoLseek(fd, -10, SCE_SEEK_END);
SceOff sceIoLseek(SceUID fd, SceOff offset, int whence)
Reposition read/write file descriptor offset.
@ SCE_SEEK_END
Starts from the end of the file.
Definition: iofilemgr.h:52
Parameters
fd- Opened file descriptor with which to seek
offset- Relative offset from the start position given by whence
whence- One of SceIoSeekMode.
Returns
The position in the file after the seek.

◆ sceIoLseek32()

long sceIoLseek32 ( SceUID  fd,
long  offset,
int  whence 
)

Reposition read/write file descriptor offset (32bit mode)

Example:
pos = sceIoLseek32(fd, -10, SCE_SEEK_END);
long sceIoLseek32(SceUID fd, long offset, int whence)
Reposition read/write file descriptor offset (32bit mode)
Parameters
fd- Opened file descriptor with which to seek
offset- Relative offset from the start position given by whence
whence- One of SceIoSeekMode.
Returns
The position in the file after the seek.

◆ sceIoRemove()

int sceIoRemove ( const char *  file)

Remove directory entry.

Parameters
file- Path to the file to remove
Returns
< 0 on error

◆ sceIoRename()

int sceIoRename ( const char *  oldname,
const char *  newname 
)

Change the name of a file.

Parameters
oldname- The old filename
newname- The new filename
Returns
< 0 on error.

◆ sceIoSync()

int sceIoSync ( const char *  device,
unsigned int  unk 
)

Synchronize the file data on the device.

Parameters
device- The device to synchronize (e.g. msfat0:)
unk- Unknown

◆ sceIoSyncByFd()

int sceIoSyncByFd ( SceUID  fd,
int  flag 
)

Synchronize the file data for one file.

Parameters
fd- Opened file descriptor to sync
flag- unknown
Returns
< 0 on error.

◆ sceIoCancel()

int sceIoCancel ( SceUID  fd)

Cancel an asynchronous operation on a file descriptor.

Parameters
fd- The file descriptor to perform cancel on.
Returns
< 0 on error.

◆ sceIoGetPriority()

int sceIoGetPriority ( SceUID  fd)

◆ sceIoGetProcessDefaultPriority()

int sceIoGetProcessDefaultPriority ( void  )

◆ sceIoGetThreadDefaultPriority()

int sceIoGetThreadDefaultPriority ( void  )

◆ sceIoSetPriority()

int sceIoSetPriority ( SceUID  fd,
int  priority 
)

◆ sceIoSetProcessDefaultPriority()

int sceIoSetProcessDefaultPriority ( int  priority)

◆ sceIoSetThreadDefaultPriority()

int sceIoSetThreadDefaultPriority ( int  priority)