MiKTeX 23.10-next
A scalable TeX distribution
|
#include <miktex/Core/File.h>
Public Types | |
enum class | LockType { Shared , Exclusive } |
File lock type. More... | |
Public Member Functions | |
File (const File &other)=delete | |
File & | operator= (const File &other)=delete |
File (File &&other)=delete | |
File & | operator= (File &&other)=delete |
Static Public Member Functions | |
static void | Delete (const MiKTeX::Util::PathName &path, FileDeleteOptionSet options) |
static void | Delete (const MiKTeX::Util::PathName &path) |
static bool | Exists (const MiKTeX::Util::PathName &path, FileExistsOptionSet options) |
static bool | Exists (const MiKTeX::Util::PathName &path) |
static FileAttributeSet | GetAttributes (const MiKTeX::Util::PathName &path) |
static unsigned long | GetNativeAttributes (const MiKTeX::Util::PathName &path) |
static std::size_t | GetSize (const MiKTeX::Util::PathName &path) |
static void | Move (const MiKTeX::Util::PathName &source, const MiKTeX::Util::PathName &dest, FileMoveOptionSet option) |
static void | Move (const MiKTeX::Util::PathName &source, const MiKTeX::Util::PathName &dest) |
static void | Copy (const MiKTeX::Util::PathName &source, const MiKTeX::Util::PathName &dest, FileCopyOptionSet options) |
static void | Copy (const MiKTeX::Util::PathName &source, const MiKTeX::Util::PathName &dest) |
static void | CreateLink (const MiKTeX::Util::PathName &oldName, const MiKTeX::Util::PathName &newName, CreateLinkOptionSet options) |
static bool | IsSymbolicLink (const MiKTeX::Util::PathName &path) |
static MiKTeX::Util::PathName | ReadSymbolicLink (const MiKTeX::Util::PathName &path) |
static bool | Equals (const MiKTeX::Util::PathName &path1, const MiKTeX::Util::PathName &path2) |
static size_t | SetMaxOpen (size_t newMax) |
static FILE * | Open (const MiKTeX::Util::PathName &path, FileMode mode, FileAccess access) |
static FILE * | Open (const MiKTeX::Util::PathName &path, FileMode mode, FileAccess access, bool isTextFile) |
static FILE * | Open (const MiKTeX::Util::PathName &path, FileMode mode, FileAccess access, bool isTextFile, FileOpenOptionSet options) |
static std::ifstream | CreateInputStream (const MiKTeX::Util::PathName &path, std::ios_base::openmode mode, std::ios_base::iostate exceptions) |
static std::ifstream | CreateInputStream (const MiKTeX::Util::PathName &path) |
static std::ofstream | CreateOutputStream (const MiKTeX::Util::PathName &path, std::ios_base::openmode mode, std::ios_base::iostate exceptions) |
static std::ofstream | CreateOutputStream (const MiKTeX::Util::PathName &path, std::ios_base::openmode mode) |
static std::ofstream | CreateOutputStream (const MiKTeX::Util::PathName &path) |
static void | SetAttributes (const MiKTeX::Util::PathName &path, FileAttributeSet attributes) |
static void | SetNativeAttributes (const MiKTeX::Util::PathName &path, unsigned long nativeAttributes) |
static void | SetTimes (int fd, time_t creationTime, time_t lastAccessTime, time_t lastWriteTime) |
static void | SetTimes (FILE *file, time_t creationTime, time_t lastAccessTime, time_t lastWriteTime) |
static void | SetTimes (const MiKTeX::Util::PathName &path, time_t creationTime, time_t lastAccessTime, time_t lastWriteTime) |
static void | GetTimes (const MiKTeX::Util::PathName &path, time_t &creationTime, time_t &lastAccessTime, time_t &lastWriteTime) |
static time_t | GetLastWriteTime (const MiKTeX::Util::PathName &path) |
static std::vector< unsigned char > | ReadAllBytes (const MiKTeX::Util::PathName &path) |
static void | WriteBytes (const MiKTeX::Util::PathName &path, const std::vector< unsigned char > &data) |
static bool | TryLock (int fd, LockType lockType, std::chrono::milliseconds timeout) |
static bool | TryLock (FILE *file, LockType lockType, std::chrono::milliseconds timeout) |
static bool | TryLock (HANDLE hFile, LockType lockType, std::chrono::milliseconds timeout) |
static void | Unlock (int fd) |
static void | Unlock (FILE *file) |
static void | Unlock (HANDLE hFile) |
File class.
This is a static class which offers file operations.
|
strong |
File lock type.
Enumerator | |
---|---|
Shared | Shared lock. |
Exclusive | Exclusive lock. |
|
inlinestatic |
Copies a file.
source | The file system path to the source file. |
dest | The file system path to the destination file. |
|
static |
Copies a file.
source | The file system path to the source file. |
dest | The file system path to the destination file. |
options | Options for copying the file. |
|
inlinestatic |
Opens an input stream on a file.
path | The file system path to the file. |
ifstream
object.
|
static |
Opens an input stream on a file.
path | The file system path to the file. |
mode | Specifies how the file is open. |
exceptions | Specifies the exceptions to be thrown if an error occurs. |
ifstream
object.
|
static |
Creates a file system link.
oldName | The file system path to the existing file. |
newName | The file system path to link. |
options | Options for creating the link. |
|
inlinestatic |
Opens an output stream on a file.
path | The file system path to the file. |
ofstream
object.
|
inlinestatic |
Opens an output stream on a file.
path | The file system path to the file. |
mode | Specifies how the file is to open. |
ofstream
object.
|
static |
Opens an output stream on a file.
path | The file system path to the file. |
mode | Specifies how the file is to open. |
exceptions | Specifies the exceptions to be thrown if an error occurs. |
ofstream
object.
|
static |
Deletes a file.
path | File system path to the file. |
|
static |
Deletes a file.
path | File system path to the file. |
options | Options for deleting the file. |
|
static |
Test equality of two files.
path1 | The file system path to the first file. |
path2 | The file system path to the second file. |
true
, if both files compare equal.
|
static |
Tests if a file exists.
path | File system path to the file. |
|
static |
Tests if a file exists.
path | File system path to the file. |
options | Options for checking the existance. |
|
static |
Get attributes of a file.
path | File system path to the file. |
|
inlinestatic |
Gets the modification timestamp of a file.
path | The file system path to the file. | |
[out] | creationTime | Creation timestamp. |
[out] | lastAccessTime | Last access timestamp. |
[out] | lastWriteTime | Last modification timestamp. |
|
static |
Get native (operating system) attributes of a file.
path | File system path to the file. |
|
static |
Gets the size of a file.
path | File system path to the file. |
|
static |
Gets file timestamps.
path | The file system path to the file. | |
[out] | creationTime | Creation timestamp. |
[out] | lastAccessTime | Last access timestamp. |
[out] | lastWriteTime | Last modification timestamp. |
|
static |
Tests if a file is a symbolic link.
path | The file system path to the file. |
true
, if the file is a symbolic link.
|
inlinestatic |
Renames (moves) a file.
source | The file system path to the source file. |
dest | The file system path to the destination file. |
|
static |
Renames (moves) a file.
source | The file system path to the source file. |
dest | The file system path to the destination file. |
options | Options for renaming the file. |
|
static |
Opens a file.
path | The file system path to the file. |
mode | Specifies how the file is to open. |
access | Specifies how the file will be accessed. |
FILE
object.
|
static |
Opens a file.
path | The file system path to the file. |
mode | Specifies how the file is to open. |
access | Specifies how the file will be accessed. |
isTextFile | Specifies if the file should be opened in text mode. |
FILE
object.
|
static |
Opens a file.
path | The file system path to the file. |
mode | Specifies how the file is to open. |
access | Specifies how the file will be accessed. |
isTextFile | Specifies if the file should be opened in text mode. |
options | Options for opening the file. |
FILE
object.
|
static |
Reads a file.
path | The file system path to the file. |
|
static |
Follows a symbolic link.
path | The file system path to the link. |
|
static |
Sets file attributes.
path | The file system path to the file. |
attributes | The attributes to set. |
|
static |
Sets the maximum number of simultaneously open files.
|
static |
Sets native (OS) file attributes.
path | The file system path to the file. |
attributes | The native attributes to set. |
|
static |
Sets file timestamps.
path | The file system path to the file. |
creationTime | Creation timestamp. |
lastAccessTime | Last access timestamp. |
lastWriteTime | Last modification timestamp. |
|
static |
Sets file timestamps.
file | The pointer to the FILE object. |
creationTime | Creation timestamp. |
lastAccessTime | Last access timestamp. |
lastWriteTime | Last modification timestamp. |
|
static |
Sets file timestamps.
fd | The file descriptor. |
creationTime | Creation timestamp. |
lastAccessTime | Last access timestamp. |
lastWriteTime | Last modification timestamp. |
|
inlinestatic |
Tries to lock a file.
file | The pointer to a FILE object. |
lockType | The requested lock type. |
timeout | The maximum time waited for the file lock. |
true
, if the file could be locked.
|
static |
Tries to lock a file.
hFile | The file HANDLE . |
lockType | The requested lock type. |
timeout | The maximum time waited for the file lock. |
true
, if the file could be locked.
|
static |
Tries to lock a file.
fd | The file descriptor. |
lockType | The requested lock type. |
timeout | The maximum time waited for the file lock. |
true
, if the file could be locked.
|
inlinestatic |
Unlocks a locked file.
file | The pointer to a FILE object. |
|
static |
Unlocks a locked file.
hFile | The file HANDLE . |
|
static |
Unlocks a locked file.
fd | The file descriptor. |
|
static |
Write a file.
path | The file system path to the file. |
The | file contents. |