vibe.core.file

File handling functions and types.

Members

Aliases

FileInfoResult
alias FileInfoResult = TaggedUnion!FileInfoResultFields
Undocumented in source.

Enums

DirectoryChangeType
enum DirectoryChangeType

Specifies the kind of change in a watched directory.

DirectoryListMode
enum DirectoryListMode
Undocumented in source.
FileMode
enum FileMode

Specifies how a file is manipulated on disk.

Functions

appendToFile
void appendToFile(NativePath path, string data)
void appendToFile(string path, string data)

Convenience function to append to a file.

copyFile
void copyFile(NativePath from, NativePath to, bool overwrite)
void copyFile(string from, string to)

Copies a file.

createDirectory
void createDirectory(NativePath path)
void createDirectory(NativePath path, Flag!"recursive" recursive)
void createDirectory(string path, Flag!"recursive" recursive)

Creates a new directory.

createTempFile
FileStream createTempFile(string suffix)

Creates and opens a temporary file for writing.

dirfd
int dirfd(DIR* )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
existsFile
bool existsFile(NativePath path)
bool existsFile(string path)

Checks if a file exists

fstatat
int fstatat(int dirfd, const(char)* pathname, stat_t* statbuf, int flags)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
fstatat
int fstatat(int dirfd, const(char)* pathname, stat_t* statbuf, int flags)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
fstatat
int fstatat(int dirfd, const(char)* pathname, stat_t* statbuf, int flags)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
getFileInfo
FileInfo getFileInfo(NativePath path)
FileInfo getFileInfo(string path)

Stores information about the specified file/directory into 'info'

getFileInfo
FileInfoResult[] getFileInfo(const(NativePath)[] paths)

Returns file information about multiple files at once.

getWorkingDirectory
NativePath getWorkingDirectory()

Returns the current working directory.

iterateDirectory
int delegate(scope int delegate(ref FileInfo)) iterateDirectory(NativePath path, DirectoryListMode mode, bool function(ref const FileInfo) @(safe) nothrow directory_predicate)
int delegate(scope int delegate(ref FileInfo)) iterateDirectory(string path, DirectoryListMode mode)

Enumerates all files in the specified directory.

listDirectory
void listDirectory(NativePath path, DirectoryListMode mode, bool delegate(FileInfo info) @(safe) del, bool function(ref const FileInfo) @(safe) nothrow directory_predicate)
void listDirectory(string path, DirectoryListMode mode, bool delegate(FileInfo info) @(safe) del)

Enumerates all files in the specified directory.

listDirectory
void listDirectory(NativePath path, bool delegate(FileInfo info) @(safe) del)
Undocumented in source. Be warned that the author may not have intended to support it.
listDirectory
void listDirectory(string path, bool delegate(FileInfo info) @(safe) del)
void listDirectory(NativePath path, DirectoryListMode mode, bool delegate(FileInfo info) @(system) del, bool function(ref const FileInfo) @(safe) nothrow directory_predicate)
void listDirectory(string path, DirectoryListMode mode, bool delegate(FileInfo info) @(system) del)
void listDirectory(NativePath path, bool delegate(FileInfo info) @(system) del)
void listDirectory(string path, bool delegate(FileInfo info) @(system) del)

Enumerates all files in the specified directory.

moveFile
void moveFile(NativePath from, NativePath to, bool copy_fallback)
void moveFile(string from, string to, bool copy_fallback)

Moves or renames a file.

openFile
FileStream openFile(NativePath path, FileMode mode)
FileStream openFile(string path, FileMode mode)

Opens a file stream with the specified mode.

readFile
ubyte[] readFile(NativePath path, ubyte[] buffer, size_t max_size)
ubyte[] readFile(string path, ubyte[] buffer, size_t max_size)

Read a whole file into a buffer.

readFileUTF8
string readFileUTF8(NativePath path)
string readFileUTF8(string path)

Read a whole UTF-8 encoded file into a string.

removeFile
void removeFile(NativePath path)
void removeFile(string path)

Removes a file

watchDirectory
DirectoryWatcher watchDirectory(NativePath path, bool recursive)

Starts watching a directory for changes.

watchDirectory
DirectoryWatcher watchDirectory(string path, bool recursive)
Undocumented in source. Be warned that the author may not have intended to support it.
writeFile
void writeFile(NativePath path, ubyte[] contents)
void writeFile(string path, ubyte[] contents)

Write a whole file at once.

writeFileUTF8
void writeFileUTF8(NativePath path, string contents)

Write a string into a UTF-8 encoded file.

Manifest constants

AT_SYMLINK_NOFOLLOW
enum AT_SYMLINK_NOFOLLOW;
Undocumented in source.
AT_SYMLINK_NOFOLLOW
enum AT_SYMLINK_NOFOLLOW;
Undocumented in source.
AT_SYMLINK_NOFOLLOW
enum AT_SYMLINK_NOFOLLOW;
Undocumented in source.

Mixins

__anonymous
mixin validateClosableRandomAccessStream!FileStream
Undocumented in source.

Structs

DirectoryChange
struct DirectoryChange

Describes a single change in a watched directory.

DirectoryWatcher
struct DirectoryWatcher

Interface for directory watcher implementations.

FileInfo
struct FileInfo

Contains general information about a file.

FileInfoResultFields
struct FileInfoResultFields
Undocumented in source.
FileStream
struct FileStream

Accesses the contents of a file as a stream.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig