C++ counterparts of SPL native functions that deal with file operations. More...
C++ counterparts of SPL native functions that deal with file operations.
|
inline |
Create a directory
name | Directory name. This must be a fully qualified name. You can use built-in functions like dataDirectory to construct the fully qualified name. |
mode | The permissions to be set on the new directory. This should have the equivalent values that would be passed to the C mkdir function. |
err | Set to 0 on success, or the errno value on failure. |
|
inline |
|
inline |
|
inline |
Open a file.
filename | File to open. This must be a fully qualified name. You can use built-in functions like dataDirectory to construct the fully qualified name. |
mode | How the file is to be used (for reading, writing, etc), as required by the system fopen() call, for example, "r" for reading. |
err | Set to 0 on success, or the errno value on failure. |
FILE
* for the file, encoded as uint64
.
|
inline |
Open a file.
filename | File to open. This must be a fully qualified name. You can use built-in functions like dataDirectory to construct the fully qualified name. |
mode | How the file is to be used (for reading, writing, etc), as required by the system fopen() call, for example, "r" for reading. |
err | Error, if any. |
FILE
* for the file, encoded as uint64
.
|
inline |
|
inline |
|
inline |
|
inline |
Set the current file position.
file | File (FILE * encoded as uint64 ). |
offset | Position to seek to, as an offset in bytes. |
whence | Indicator specifying where position is relative to (optSEEK_SET() , optSEEK_CUR() or optSEEK_END() ). |
err | Set to 0 on success, or the errno value on failure. |
|
inline |
Return the indicator for specifying to seek relative to the start of the file.
SEEK_SET
indicator.
|
inline |
Return the indicator for specifying to seek relative to the current file position.
SEEK_CUR
indicator.
|
inline |
Return the indicator for specifying to seek relative to the end of the file.
SEEK_END
indicator.
|
inline |
|
inline |
Test if the stream is at the end of the file.
file | File (FILE * encoded as uint64 ). |
|
inline |
Clear the error and end-of-file indicators for an open file.
file | File (FILE * encoded as uint64 ). |
void SPL::Functions::File::fstat | ( | const SPL::rstring & | file, |
const SPL::rstring & | what, | ||
SPL::uint64 & | result, | ||
SPL::int32 & | err | ||
) |
Return information about a file.
file | File name. This must be a fully qualified name. You can use built-in functions like dataDirectory to construct the fully qualified name. |
what | Desired information from the system call stat : one of "dev", "rdev", "ino", "mode", "nlink", "uid", "gid", "size", "blksize", or "blocks". |
result | Returned information. |
err | Set to 0 on success, or the errno value on failure (EINVAL if the what string is not valid). |
|
inline |
Return information about a file.
file | File name. This must be a fully qualified name. You can use built-in functions like dataDirectory to construct the fully qualified name. |
what | Desired information from the system call stat : one of "dev", "rdev", "ino", "mode", "nlink", "uid", "gid", "size", "blksize", or "blocks". |
result | Returned information. |
err | Set to 0 on success, or the errno value on failure (EINVAL if the what string is not valid). |
void SPL::Functions::File::fstat | ( | const SPL::rstring & | file, |
const SPL::rstring & | what, | ||
SPL::timestamp & | result, | ||
SPL::int32 & | err | ||
) |
Return timestamp information about a file.
file | File name. This must be a fully qualified name. You can use built-in functions like dataDirectory to construct the fully qualified name. |
what | Desired information from the system call stat : one of "atime", "mtime", or "ctime". |
result | Returned information. |
err | Set to 0 on success, or the errno value on failure (EINVAL if the what string is not valid). |
|
inline |
Return timestamp information about a file.
file | File name. This must be a fully qualified name. You can use built-in functions like dataDirectory to construct the fully qualified name. |
what | Desired information from the system call stat : one of "atime", "mtime", or "ctime". |
result | Returned information. |
err | Set to 0 on success, or the errno value on failure (EINVAL if the what string is not valid). |
void SPL::Functions::File::fstat | ( | const SPL::uint64 | file, |
const SPL::rstring & | what, | ||
SPL::uint64 & | result, | ||
SPL::int32 & | err | ||
) |
Return information about a file.
file | File (FILE * encoded as uint64 ). |
what | Desired information from the system call fstat : one of "dev", "rdev", "ino", "mode", "nlink", "uid", "gid", "size", "blksize", or "blocks". |
result | Returned information. |
err | Set to 0 on success, or the errno value on failure (EINVAL if the what string is not valid). |
|
inline |
Return information about a file.
file | File (FILE * encoded as uint64 ). |
what | Desired information from the system call fstat : one of "dev", "rdev", "ino", "mode", "nlink", "uid", "gid", "size", "blksize", or "blocks". |
result | Returned information. |
err | Set to 0 on success, or the errno value on failure (EINVAL if the what string is not valid). |
void SPL::Functions::File::fstat | ( | const SPL::uint64 | file, |
const SPL::rstring & | what, | ||
SPL::timestamp & | result, | ||
SPL::int32 & | err | ||
) |
Return timestamp information about a file.
|
inline |
Return timestamp information about a file.
void SPL::Functions::File::fwriteString | ( | const char * | val, |
SPL::uint64 | len, | ||
const SPL::uint64 | file, | ||
SPL::int32 & | err | ||
) |
|
inline |
|
inline |
|
inline |
void SPL::Functions::File::fwriteTxt | ( | const SPL::ConstValueHandle & | val, |
const SPL::uint64 | file, | ||
SPL::int32 & | err | ||
) |
void SPL::Functions::File::fwriteBin | ( | const SPL::ConstValueHandle & | val, |
const SPL::uint64 | file, | ||
SPL::int32 & | err | ||
) |
void SPL::Functions::File::fwrite | ( | const SPL::list< SPL::uint8 > & | val, |
const SPL::uint64 | file, | ||
const SPL::uint64 | loffset, | ||
const SPL::uint64 | length, | ||
SPL::int32 & | err | ||
) |
SPL::rstring SPL::Functions::File::freadToken | ( | const SPL::uint64 | file, |
SPL::int32 & | err | ||
) |
Read a 'token' from a file. A token is a series of non-whitespace characters. Whitespace is skipped until a non-whitespace character is found, and then all non-whitespace characters in the token are returned.
file | File (FILE * encoded as uint64 ). |
err | Set to 0 on success, or -1 if the end of the file is reached. |
SPL::rstring SPL::Functions::File::freadLine | ( | const SPL::uint64 | file, |
SPL::int32 & | err | ||
) |
|
inline |
|
inline |
SPL::uint64 SPL::Functions::File::fread | ( | SPL::list< SPL::uint8 > & | res, |
const SPL::uint64 | file, | ||
const SPL::uint64 | length, | ||
SPL::int32 & | err | ||
) |
void SPL::Functions::File::freadfile | ( | SPL::blob & | res, |
const SPL::uint64 | file, | ||
SPL::int32 & | err | ||
) |
void SPL::Functions::File::fwriteblob | ( | const SPL::blob & | b, |
const SPL::uint64 | file, | ||
SPL::int32 & | err | ||
) |
|
inline |
Return whether the value is EOF
.
v | Value. |
EOF
.
|
inline |
Return whether the value is EACCES
.
v | Value. |
EACCES
.
|
inline |
Return whether the value is EAGAIN
.
v | Value. |
EAGAIN
.
|
inline |
Return whether the value is EBADF
.
v | Value. |
EBADF
.
|
inline |
Return whether the value is EFAULT
.
v | Value. |
EFAULT
.
|
inline |
Return whether the value is EFBIG
.
v | Value. |
EFBIG
.
|
inline |
Return whether the value is EINTR
.
v | Value. |
EINTR
.
|
inline |
Return whether the value is EINVAL
.
v | Value. |
EINVAL
.
|
inline |
Return whether the value is EIO
.
v | Value. |
EIO
.
|
inline |
Return whether the value is EISDIR
.
v | Value. |
EISDIR
.
|
inline |
Return whether the value is EMFILE
.
v | Value. |
EMFILE
.
|
inline |
Return whether the value is ENFILE
.
v | Value. |
ENFILE
.
|
inline |
Return whether the value is ELOOP
.
v | Value. |
ELOOP
.
|
inline |
Return whether the value is ENAMETOOLONG
.
v | Value. |
ENAMETOOLONG
.
|
inline |
Return whether the value is ENODEV
.
v | Value. |
ENODEV
.
|
inline |
Return whether the value is ENOENT
.
v | Value. |
ENOENT
.
|
inline |
Return whether the value is ENOMEM
.
v | Value. |
ENOMEM
.
|
inline |
Return whether the value is ENOSPC
.
v | Value. |
ENOSPC
.
|
inline |
Return whether the value is ENOTDIR
.
v | Value. |
ENOTDIR
.
|
inline |
Return whether the value is ENXIO
.
v | Value. |
ENXIO
.
|
inline |
Return whether the value is EOVERFLOW
.
v | Value. |
EOVERFLOW
.
|
inline |
Return whether the value is EPIPE
.
v | Value. |
EPIPE
.
|
inline |
Return whether the value is EPERM
.
v | Value. |
EPERM
.
|
inline |
Return whether the value is EROFS
.
v | Value. |
EROFS
.
|
inline |
Return whether the value is ESPIPE
.
v | Value. |
ESPIPE
.
|
inline |
Return whether the value is ETXTBSY
.
v | Value. |
ETXTBSY
.
|
inline |
Return whether the value is EWOULDBLOCK
.
v | Value. |
EWOULDBLOCK
.