Module vibe.core.file
File handling functions and types.
Functions
Name | Description |
---|---|
appendToFile(path, data)
|
Convenience function to append to a file. |
copyFile(from, to, overwrite)
|
Copies a file. |
createDirectory(path)
|
Creates a new directory. |
createTempFile(suffix)
|
Creates and opens a temporary file for writing. |
dirfd()
|
|
existsFile(path)
|
Checks if a file exists |
fstatat(dirfd, pathname, statbuf, flags)
|
|
getFileInfo(path)
|
Stores information about the specified file/directory into 'info' |
getFileInfo(paths)
|
Returns file information about multiple files at once. |
getWorkingDirectory()
|
Returns the current working directory. |
iterateDirectory(path, mode, directory_predicate)
|
|
listDirectory(path, mode, del, directory_predicate)
|
Enumerates all files in the specified directory. |
listDirectory(path, del)
|
|
moveFile(from, to, copy_fallback)
|
Moves or renames a file. |
openFile(path, mode)
|
Opens a file stream with the specified mode. |
readFile(path, buffer, max_size)
|
Read a whole file into a buffer. |
readFileUTF8(path)
|
Read a whole UTF-8 encoded file into a string. |
removeFile(path)
|
Removes a file |
watchDirectory(path, recursive)
|
Starts watching a directory for changes. |
watchDirectory(path, recursive)
|
|
writeFile(path, contents)
|
Write a whole file at once. |
writeFileUTF8(path, contents)
|
Write a string into a UTF-8 encoded file. |
Structs
Name | Description |
---|---|
DirectoryChange
|
Describes a single change in a watched directory. |
DirectoryWatcher
|
Interface for directory watcher implementations. |
FileInfo
|
Contains general information about a file. |
FileInfoResultFields
|
|
FileStream
|
Accesses the contents of a file as a stream. |
Enums
Name | Description |
---|---|
DirectoryChangeType
|
Specifies the kind of change in a watched directory. |
DirectoryListMode
|
|
FileMode
|
Specifies how a file is manipulated on disk. |
Manifest constants
Name | Type | Description |
---|---|---|
_createFileModeValue
|
Aliases
Name | Type | Description |
---|---|---|
FileInfoResult
|
TaggedUnion!(vibe.core.file.FileInfoResultFields)
|