Final Platform Layer  0.9.6-beta
Data Structures | Typedefs | Enumerations | Functions
Files/IO functions

This category contains and types and functions for handling files & directories. More...

Data Structures

struct  fplFileEntry
 A structure containing the informations for a file or directory (name, type, attributes, etc.) More...
 
struct  fplFileHandle
 The filehandle structure. More...
 
union  fplFilePermissions
 A union containing the file permissions (UMask) More...
 
struct  fplFileTimeStamps
 A structure containing filestamps for creation/access/modify date. More...
 
union  fplInternalFileEntryHandle
 A union containing the internal filehandle for any platform. More...
 
union  fplInternalFileHandle
 A union containing the internal filehandle for any platform. More...
 
struct  fplInternalFileRootInfo
 A structure containing the internal root file informations. More...
 

Typedefs

typedef enum fplFileAttributeFlags fplFileAttributeFlags
 An enumeratation of file attribute flags (Normal, Readonly, Hidden, etc.)
 
typedef struct fplFileEntry fplFileEntry
 A structure containing the informations for a file or directory (name, type, attributes, etc.)
 
typedef enum fplFileEntryType fplFileEntryType
 An enumeration of file entry types (File, Directory, etc.)
 
typedef struct fplFileHandle fplFileHandle
 The filehandle structure.
 
typedef enum fplFilePermissionFlags fplFilePermissionFlags
 An enumeration of file permission flags.
 
typedef enum fplFilePermissionMasks fplFilePermissionMasks
 An enumeration of file permission types.
 
typedef union fplFilePermissions fplFilePermissions
 A union containing the file permissions (UMask)
 
typedef enum fplFilePositionMode fplFilePositionMode
 An enumeration of file position modes (Beginning, Current, End)
 
typedef uint64_t fplFileTimeStamp
 The elapsed seconds since the UNIX epoch (1970-01-01 00:00:00)
 
typedef struct fplFileTimeStamps fplFileTimeStamps
 A structure containing filestamps for creation/access/modify date.
 
typedef union fplInternalFileEntryHandle fplInternalFileEntryHandle
 A union containing the internal filehandle for any platform.
 
typedef union fplInternalFileHandle fplInternalFileHandle
 A union containing the internal filehandle for any platform.
 
typedef struct fplInternalFileRootInfo fplInternalFileRootInfo
 A structure containing the internal root file informations.
 

Enumerations

enum  fplFileAttributeFlags {
  fplFileAttributeFlags_None, fplFileAttributeFlags_Normal, fplFileAttributeFlags_Hidden, fplFileAttributeFlags_System,
  fplFileAttributeFlags_Archive
}
 An enumeratation of file attribute flags (Normal, Readonly, Hidden, etc.) More...
 
enum  fplFileEntryType { fplFileEntryType_Unknown, fplFileEntryType_File, fplFileEntryType_Directory }
 An enumeration of file entry types (File, Directory, etc.) More...
 
enum  fplFilePermissionFlags { fplFilePermissionFlags_All, fplFilePermissionFlags_CanExecuteSearch, fplFilePermissionFlags_CanWrite, fplFilePermissionFlags_CanRead }
 An enumeration of file permission flags. More...
 
enum  fplFilePermissionMasks { fplFilePermissionMasks_None, fplFilePermissionMasks_User, fplFilePermissionMasks_Group, fplFilePermissionMasks_Owner }
 An enumeration of file permission types. More...
 
enum  fplFilePositionMode { fplFilePositionMode_Beginning, fplFilePositionMode_Current, fplFilePositionMode_End }
 An enumeration of file position modes (Beginning, Current, End) More...
 

Functions

 FPL_ENUM_AS_FLAGS_OPERATORS (fplFileAttributeFlags)
 FileAttributeFlags operator overloads for C++.
 
 FPL_ENUM_AS_FLAGS_OPERATORS (fplFilePermissionFlags)
 fplFilePermissionFlags operator overloads for C++
 
 FPL_ENUM_AS_FLAGS_OPERATORS (fplFilePermissionMasks)
 fplFilePermissionMasks operator overloads for C++
 
fpl_platform_api void fplCloseFile (fplFileHandle *fileHandle)
 Closes the given file and releases the underlying resources and clears the handle to zero. More...
 
fpl_platform_api bool fplCreateBinaryFile (const char *filePath, fplFileHandle *outHandle)
 Create a binary file for writing to the given string path and returns the handle of it. More...
 
fpl_platform_api bool fplDirectoriesCreate (const char *path)
 Creates all the directories in the given path. More...
 
fpl_platform_api bool fplDirectoryExists (const char *path)
 Checks if the given directory exists and returns a boolean indicating its existence. More...
 
fpl_platform_api bool fplDirectoryRemove (const char *path)
 Deletes the given empty directory without confirmation and returns true when the deletion was successful. More...
 
fpl_platform_api bool fplFileCopy (const char *sourceFilePath, const char *targetFilePath, const bool overwrite)
 Copies the given source file to the target path and returns true when the copy was successful. More...
 
fpl_platform_api bool fplFileDelete (const char *filePath)
 Deletes the given file without confirmation and returns true when the deletion was successful. More...
 
fpl_platform_api bool fplFileExists (const char *filePath)
 Checks if the file exists and returns a boolean indicating the existence. More...
 
fpl_platform_api bool fplFileMove (const char *sourceFilePath, const char *targetFilePath)
 Movies the given source file to the target file and returns true when the move was successful. More...
 
fpl_platform_api bool fplFlushFile (fplFileHandle *fileHandle)
 Flushes the buffers of the given file and causes all buffered data to be written to a file. More...
 
fpl_common_api size_t fplGetFilePosition (const fplFileHandle *fileHandle)
 Gets the current file position in bytes. More...
 
fpl_platform_api uint32_t fplGetFilePosition32 (const fplFileHandle *fileHandle)
 Gets the current file position in bytes. More...
 
fpl_platform_api uint64_t fplGetFilePosition64 (const fplFileHandle *fileHandle)
 Gets the current file position in bytes. More...
 
fpl_common_api size_t fplGetFileSizeFromHandle (const fplFileHandle *fileHandle)
 Gets the file size in bytes for an opened file. More...
 
fpl_platform_api uint32_t fplGetFileSizeFromHandle32 (const fplFileHandle *fileHandle)
 Gets the file size in bytes for an opened file. More...
 
fpl_platform_api uint64_t fplGetFileSizeFromHandle64 (const fplFileHandle *fileHandle)
 Gets the file size in bytes for an opened file. More...
 
fpl_platform_api size_t fplGetFileSizeFromPath (const char *filePath)
 Gets the file size in bytes for the given file. More...
 
fpl_platform_api uint32_t fplGetFileSizeFromPath32 (const char *filePath)
 Gets the file size in bytes for the given file. More...
 
fpl_platform_api uint64_t fplGetFileSizeFromPath64 (const char *filePath)
 Gets the file size in bytes for the given file. More...
 
fpl_platform_api bool fplGetFileTimestampsFromHandle (const fplFileHandle *fileHandle, fplFileTimeStamps *outStamps)
 Gets the timestamps for an opened file. More...
 
fpl_platform_api bool fplGetFileTimestampsFromPath (const char *filePath, fplFileTimeStamps *outStamps)
 Gets the timestamps for the given file. More...
 
fpl_platform_api bool fplListDirBegin (const char *path, const char *filter, fplFileEntry *entry)
 Iterates through files/directories in the given directory. More...
 
fpl_platform_api void fplListDirEnd (fplFileEntry *entry)
 Releases opened resources from iterating through files/directories. More...
 
fpl_platform_api bool fplListDirNext (fplFileEntry *entry)
 Gets the next file entry from iterating through files/directories. More...
 
fpl_platform_api bool fplOpenBinaryFile (const char *filePath, fplFileHandle *outHandle)
 Opens a binary file for reading from a string path and returns the handle of it. More...
 
fpl_platform_api size_t fplReadFileBlock (const fplFileHandle *fileHandle, const size_t sizeToRead, void *targetBuffer, const size_t maxTargetBufferSize)
 Reads a block from the given file and returns the number of bytes read. More...
 
fpl_platform_api uint32_t fplReadFileBlock32 (const fplFileHandle *fileHandle, const uint32_t sizeToRead, void *targetBuffer, const uint32_t maxTargetBufferSize)
 Reads a block from the given file and returns the number of bytes read. More...
 
fpl_platform_api uint64_t fplReadFileBlock64 (const fplFileHandle *fileHandle, const uint64_t sizeToRead, void *targetBuffer, const uint64_t maxTargetBufferSize)
 Reads a block from the given file and returns the number of bytes read. More...
 
fpl_common_api size_t fplSetFilePosition (const fplFileHandle *fileHandle, const intptr_t position, const fplFilePositionMode mode)
 Sets the current file position by the given position, depending on the mode it's absolute or relative. More...
 
fpl_platform_api uint32_t fplSetFilePosition32 (const fplFileHandle *fileHandle, const int32_t position, const fplFilePositionMode mode)
 Sets the current file position by the given position, depending on the mode it's absolute or relative. More...
 
fpl_platform_api uint64_t fplSetFilePosition64 (const fplFileHandle *fileHandle, const int64_t position, const fplFilePositionMode mode)
 Sets the current file position by the given position, depending on the mode it's absolute or relative. More...
 
fpl_platform_api bool fplSetFileTimestamps (const char *filePath, const fplFileTimeStamps *timeStamps)
 Sets the timestamps for the given file. More...
 
fpl_common_api size_t fplWriteFileBlock (const fplFileHandle *fileHandle, void *sourceBuffer, const size_t sourceSize)
 Writes a block to the given file and returns the number of written bytes. More...
 
fpl_platform_api uint32_t fplWriteFileBlock32 (const fplFileHandle *fileHandle, void *sourceBuffer, const uint32_t sourceSize)
 Writes a block to the given file and returns the number of written bytes. More...
 
fpl_platform_api uint64_t fplWriteFileBlock64 (const fplFileHandle *fileHandle, void *sourceBuffer, const uint64_t sourceSize)
 Writes a block to the given file and returns the number of written bytes. More...
 

Detailed Description

This category contains and types and functions for handling files & directories.

Enumeration Type Documentation

◆ fplFileAttributeFlags

An enumeratation of file attribute flags (Normal, Readonly, Hidden, etc.)

Enumerator
fplFileAttributeFlags_None 

No attributes.

fplFileAttributeFlags_Normal 

Normal.

fplFileAttributeFlags_Hidden 

Hidden.

fplFileAttributeFlags_System 

System.

fplFileAttributeFlags_Archive 

Archive.

Definition at line 5127 of file final_platform_layer.h.

◆ fplFileEntryType

An enumeration of file entry types (File, Directory, etc.)

Enumerator
fplFileEntryType_Unknown 

Unknown entry type.

fplFileEntryType_File 

Entry is a file.

fplFileEntryType_Directory 

Entry is a directory.

Definition at line 5073 of file final_platform_layer.h.

◆ fplFilePermissionFlags

An enumeration of file permission flags.

Enumerator
fplFilePermissionFlags_All 

All (Read, Write, Execute, Search)

fplFilePermissionFlags_CanExecuteSearch 

CanExecute.

fplFilePermissionFlags_CanWrite 

CanWrite.

fplFilePermissionFlags_CanRead 

CanRead.

Definition at line 5083 of file final_platform_layer.h.

◆ fplFilePermissionMasks

An enumeration of file permission types.

Enumerator
fplFilePermissionMasks_None 

No mask.

fplFilePermissionMasks_User 

User.

fplFilePermissionMasks_Group 

Group.

fplFilePermissionMasks_Owner 

Owner.

Definition at line 5097 of file final_platform_layer.h.

◆ fplFilePositionMode

An enumeration of file position modes (Beginning, Current, End)

Enumerator
fplFilePositionMode_Beginning 

Starts from the beginning.

fplFilePositionMode_Current 

Starts from the current position.

fplFilePositionMode_End 

Starts from the end.

Definition at line 5063 of file final_platform_layer.h.

Function Documentation

◆ fplCloseFile()

fpl_platform_api void fplCloseFile ( fplFileHandle fileHandle)

Closes the given file and releases the underlying resources and clears the handle to zero.

Parameters
fileHandleThe pointer to the fplFileHandle structure
See also
Opening a Binary File

◆ fplCreateBinaryFile()

fpl_platform_api bool fplCreateBinaryFile ( const char *  filePath,
fplFileHandle outHandle 
)

Create a binary file for writing to the given string path and returns the handle of it.

Parameters
filePathThe file path
outHandleThe pointer to the fplFileHandle structure
Returns
Returns true when the binary file was created, false otherwise.
See also
Creating a Binary File

◆ fplDirectoriesCreate()

fpl_platform_api bool fplDirectoriesCreate ( const char *  path)

Creates all the directories in the given path.

Parameters
pathThe path to the directory
Returns
Returns true when at least one directory was created, false otherwise.

◆ fplDirectoryExists()

fpl_platform_api bool fplDirectoryExists ( const char *  path)

Checks if the given directory exists and returns a boolean indicating its existence.

Parameters
pathThe path to the directory
Returns
Returns true when the directory exists, false otherwise.

◆ fplDirectoryRemove()

fpl_platform_api bool fplDirectoryRemove ( const char *  path)

Deletes the given empty directory without confirmation and returns true when the deletion was successful.

Parameters
pathThe path to the directory.
Returns
Returns true when the empty directory was deleted, false otherwise.

◆ fplFileCopy()

fpl_platform_api bool fplFileCopy ( const char *  sourceFilePath,
const char *  targetFilePath,
const bool  overwrite 
)

Copies the given source file to the target path and returns true when the copy was successful.

Parameters
sourceFilePathThe source file path
targetFilePathThe target file path
overwriteThe overwrite boolean indicating if the file can be overwritten or not
Returns
Returns true when the file was copied, false otherwise.

◆ fplFileDelete()

fpl_platform_api bool fplFileDelete ( const char *  filePath)

Deletes the given file without confirmation and returns true when the deletion was successful.

Parameters
filePathThe path to the file
Returns
Returns true when the file was deleted, false otherwise.

◆ fplFileExists()

fpl_platform_api bool fplFileExists ( const char *  filePath)

Checks if the file exists and returns a boolean indicating the existence.

Parameters
filePathThe path to the file
Returns
Returns true when the file exists, false otherwise.

◆ fplFileMove()

fpl_platform_api bool fplFileMove ( const char *  sourceFilePath,
const char *  targetFilePath 
)

Movies the given source file to the target file and returns true when the move was successful.

Parameters
sourceFilePathThe source file path
targetFilePathThe target file path
Returns
Returns true when the file was moved, false otherwise.

◆ fplFlushFile()

fpl_platform_api bool fplFlushFile ( fplFileHandle fileHandle)

Flushes the buffers of the given file and causes all buffered data to be written to a file.

Parameters
fileHandleThe pointer to the fplFileHandle structure
Returns
Returns true when file buffer was flushed, false otherwise.

◆ fplGetFilePosition()

fpl_common_api size_t fplGetFilePosition ( const fplFileHandle fileHandle)

Gets the current file position in bytes.

Parameters
fileHandleThe pointer to the fplFileHandle structure
Returns
Returns the current file position in bytes.
Note
Depending on the platform/architecture, this supports a max size of 2^31 or 2^63 bytes
See also
Getting the current file position

◆ fplGetFilePosition32()

fpl_platform_api uint32_t fplGetFilePosition32 ( const fplFileHandle fileHandle)

Gets the current file position in bytes.

Parameters
fileHandleThe pointer to the fplFileHandle structure
Returns
Returns the current file position in bytes.
Note
Supports max size of 2^31
See also
Getting the current file position

◆ fplGetFilePosition64()

fpl_platform_api uint64_t fplGetFilePosition64 ( const fplFileHandle fileHandle)

Gets the current file position in bytes.

Parameters
fileHandleThe pointer to the fplFileHandle structure
Returns
Returns the current file position in bytes.
Note
Supports max size of 2^63
See also
Getting the current file position

◆ fplGetFileSizeFromHandle()

fpl_common_api size_t fplGetFileSizeFromHandle ( const fplFileHandle fileHandle)

Gets the file size in bytes for an opened file.

Parameters
fileHandleThe pointer to the fplFileHandle structure
Returns
Returns the file size in bytes or zero.
Note
Depending on the platform/architecture, this supports a max size of 2^31 or 2^63 bytes

◆ fplGetFileSizeFromHandle32()

fpl_platform_api uint32_t fplGetFileSizeFromHandle32 ( const fplFileHandle fileHandle)

Gets the file size in bytes for an opened file.

Parameters
fileHandleThe pointer to the fplFileHandle structure
Returns
Returns the file size in bytes or zero.
Note
Supports max size of 2^31

◆ fplGetFileSizeFromHandle64()

fpl_platform_api uint64_t fplGetFileSizeFromHandle64 ( const fplFileHandle fileHandle)

Gets the file size in bytes for an opened file.

Parameters
fileHandleThe pointer to the fplFileHandle structure
Returns
Returns the file size in bytes or zero.
Note
Supports max size of 2^63

◆ fplGetFileSizeFromPath()

fpl_platform_api size_t fplGetFileSizeFromPath ( const char *  filePath)

Gets the file size in bytes for the given file.

Parameters
filePathThe path to the file
Returns
Returns the file size in bytes or zero.
Note
Depending on the platform/architecture, this supports a max size of 2^31 or 2^63 bytes

◆ fplGetFileSizeFromPath32()

fpl_platform_api uint32_t fplGetFileSizeFromPath32 ( const char *  filePath)

Gets the file size in bytes for the given file.

Parameters
filePathThe path to the file
Returns
Returns the file size in bytes or zero.
Note
Supports max size of 2^31

◆ fplGetFileSizeFromPath64()

fpl_platform_api uint64_t fplGetFileSizeFromPath64 ( const char *  filePath)

Gets the file size in bytes for the given file.

Parameters
filePathThe path to the file
Returns
Returns the file size in bytes or zero.
Note
Supports max size of 2^63

◆ fplGetFileTimestampsFromHandle()

fpl_platform_api bool fplGetFileTimestampsFromHandle ( const fplFileHandle fileHandle,
fplFileTimeStamps outStamps 
)

Gets the timestamps for an opened file.

Parameters
fileHandleThe pointer to the fplFileHandle structure
outStampsThe pointer to the fplFileTimeStamps structure
Returns
Returns true when the function succeeded, false otherwise.

◆ fplGetFileTimestampsFromPath()

fpl_platform_api bool fplGetFileTimestampsFromPath ( const char *  filePath,
fplFileTimeStamps outStamps 
)

Gets the timestamps for the given file.

Parameters
filePathThe path to the file
outStampsThe pointer to the fplFileTimeStamps structure
Returns
Returns true when the function succeeded, false otherwise.

◆ fplListDirBegin()

fpl_platform_api bool fplListDirBegin ( const char *  path,
const char *  filter,
fplFileEntry entry 
)

Iterates through files/directories in the given directory.

Parameters
pathThe full path
filterThe filter wildcard (If empty or null it will not filter anything at all)
entryThe pointer to the fplFileEntry structure
Returns
Returns true when there was a first entry found, false otherwise.
Note
This function is not recursive, so it will traverse the first level only!
When no initial entry is found, the resources are automatically cleaned up.
See also
Directory Traversing

◆ fplListDirEnd()

fpl_platform_api void fplListDirEnd ( fplFileEntry entry)

Releases opened resources from iterating through files/directories.

Parameters
entryThe pointer to the fplFileEntry structure
Note
It's safe to call this when the file entry is already closed.
See also
Directory Traversing

◆ fplListDirNext()

fpl_platform_api bool fplListDirNext ( fplFileEntry entry)

Gets the next file entry from iterating through files/directories.

Parameters
entryThe pointer to the fplFileEntry structure
Returns
Returns true when there was a next file otherwise false if not.
Note
This function is not recursive, so it will traverse the first level only!
When no entries are found, the resources are automatically cleaned up.
See also
Directory Traversing

◆ fplOpenBinaryFile()

fpl_platform_api bool fplOpenBinaryFile ( const char *  filePath,
fplFileHandle outHandle 
)

Opens a binary file for reading from a string path and returns the handle of it.

Parameters
filePathThe file path
outHandleThe pointer to the fplFileHandle structure
Returns
Returns true when the binary file was opened, false otherwise.
See also
Opening a Binary File

◆ fplReadFileBlock()

fpl_platform_api size_t fplReadFileBlock ( const fplFileHandle fileHandle,
const size_t  sizeToRead,
void *  targetBuffer,
const size_t  maxTargetBufferSize 
)

Reads a block from the given file and returns the number of bytes read.

Parameters
fileHandleThe pointer to the fplFileHandle structure
sizeToReadThe number of bytes to read
targetBufferThe target memory to write into
maxTargetBufferSizeTotal number of bytes available in the target buffer
Returns
Returns the number of bytes read or zero.
Note
Depending on the platform/architecture, this supports a max size of 2^31 or 2^63 bytes
See also
Reading from the file

◆ fplReadFileBlock32()

fpl_platform_api uint32_t fplReadFileBlock32 ( const fplFileHandle fileHandle,
const uint32_t  sizeToRead,
void *  targetBuffer,
const uint32_t  maxTargetBufferSize 
)

Reads a block from the given file and returns the number of bytes read.

Parameters
fileHandleThe pointer to the fplFileHandle structure
sizeToReadThe number of bytes to read
targetBufferThe target memory to write into
maxTargetBufferSizeTotal number of bytes available in the target buffer
Returns
Returns the number of bytes read or zero.
Note
Supports max size of 2^31
See also
Reading from the file

◆ fplReadFileBlock64()

fpl_platform_api uint64_t fplReadFileBlock64 ( const fplFileHandle fileHandle,
const uint64_t  sizeToRead,
void *  targetBuffer,
const uint64_t  maxTargetBufferSize 
)

Reads a block from the given file and returns the number of bytes read.

Parameters
fileHandleThe pointer to the fplFileHandle structure
sizeToReadThe number of bytes to read
targetBufferThe target memory to write into
maxTargetBufferSizeTotal number of bytes available in the target buffer
Returns
Returns the number of bytes read or zero.
Note
Supports max size of 2^63
See also
Reading from the file

◆ fplSetFilePosition()

fpl_common_api size_t fplSetFilePosition ( const fplFileHandle fileHandle,
const intptr_t  position,
const fplFilePositionMode  mode 
)

Sets the current file position by the given position, depending on the mode it's absolute or relative.

Parameters
fileHandleThe pointer to the fplFileHandle structure
positionPosition in bytes
modePosition mode
Note
Depending on the platform/architecture, this supports a max size of 2^31 or 2^63 bytes
See also
Setting the current file position (Seeking)

◆ fplSetFilePosition32()

fpl_platform_api uint32_t fplSetFilePosition32 ( const fplFileHandle fileHandle,
const int32_t  position,
const fplFilePositionMode  mode 
)

Sets the current file position by the given position, depending on the mode it's absolute or relative.

Parameters
fileHandleThe pointer to the fplFileHandle structure
positionPosition in bytes
modePosition mode
Note
Supports max size of 2^31
See also
Setting the current file position (Seeking)

◆ fplSetFilePosition64()

fpl_platform_api uint64_t fplSetFilePosition64 ( const fplFileHandle fileHandle,
const int64_t  position,
const fplFilePositionMode  mode 
)

Sets the current file position by the given position, depending on the mode it's absolute or relative.

Parameters
fileHandleThe pointer to the fplFileHandle structure
positionPosition in bytes
modePosition mode
Note
Supports max size of 2^63
See also
Setting the current file position (Seeking)

◆ fplSetFileTimestamps()

fpl_platform_api bool fplSetFileTimestamps ( const char *  filePath,
const fplFileTimeStamps timeStamps 
)

Sets the timestamps for the given file.

Parameters
filePathThe path to the file
timeStampsThe pointer to the fplFileTimeStamps structure
Returns
Returns true when the function succeeded, false otherwise.

◆ fplWriteFileBlock()

fpl_common_api size_t fplWriteFileBlock ( const fplFileHandle fileHandle,
void *  sourceBuffer,
const size_t  sourceSize 
)

Writes a block to the given file and returns the number of written bytes.

Parameters
fileHandleThe pointer to the filehandle fplFileHandle
sourceBufferSource memory to read from
sourceSizeNumber of bytes to write
Returns
Returns the number of bytes written or zero.
Note
Depending on the platform/architecture, this supports a max size of 2^31 or 2^63 bytes
See also
Writing to the file

◆ fplWriteFileBlock32()

fpl_platform_api uint32_t fplWriteFileBlock32 ( const fplFileHandle fileHandle,
void *  sourceBuffer,
const uint32_t  sourceSize 
)

Writes a block to the given file and returns the number of written bytes.

Parameters
fileHandleThe pointer to the filehandle fplFileHandle
sourceBufferSource memory to read from
sourceSizeNumber of bytes to write
Returns
Returns the number of bytes written or zero.
Note
Supports max size of 2^31
See also
Writing to the file

◆ fplWriteFileBlock64()

fpl_platform_api uint64_t fplWriteFileBlock64 ( const fplFileHandle fileHandle,
void *  sourceBuffer,
const uint64_t  sourceSize 
)

Writes a block to the given file and returns the number of written bytes.

Parameters
fileHandleThe pointer to the filehandle fplFileHandle
sourceBufferSource memory to read from
sourceSizeNumber of bytes to write
Returns
Returns the number of bytes written or zero.
Note
Supports max size of 2^63
See also
Writing to the file