|
Safeheron-SGX-Native-Development-Framework v1.2.0
|
This module is designed to operate directly on files and directories in enclave. More...
Classes | |
| class | FileStatus |
| A class to store file type and permissions. More... | |
| class | FileSystemException |
| Exception about filesystem. More... | |
| class | Path |
| A class for storing path. More... | |
| class | PlainFileReader |
| Read a plaintext file (file size <= 100 KB) More... | |
| class | PlainFileWriter |
| Write a plaintext file (file size <= 100 KB) More... | |
| class | ProtectedFileReader |
| A ProtectedFileReader for reading from the Intel SGX Protected File System. More... | |
| class | ProtectedFileWriter |
| A ProtectedFileWriter for writing to the Intel SGX Protected File System. More... | |
Enumerations | |
| enum class | FileType { None = 0 , NotFound , Regular , Directory , Symlink , Block , Character , Fifo , Socket , Unknown } |
| File type enum. More... | |
| enum class | Perms : unsigned { None = 0 , OwnerRead = 0400 , OwnerWrite = 0200 , OwnerExec = 0100 , OwnerAll = 0700 , GroupRead = 040 , GroupWrite = 020 , GroupExec = 010 , GroupAll = 070 , OthersRead = 04 , OthersWrite = 02 , OthersExec = 01 , OthersAll = 07 , All = 0777 , SetUid = 04000 , SetGid = 02000 , StickyBit = 01000 , Mask = 07777 , Unknown = 0xFFFF } |
| File permissions (Octal) More... | |
| enum class | FileMode { CreateNew = 1 , OpenOrCreate = 2 , Append = 3 } |
| The mode for file writing operation. More... | |
Functions | |
| bool | CreateDirectory (const Path &p) |
| Create a directory (attribute default 0755) | |
| FileStatus | Status (const Path &p) |
| Retrieve file type and permissions; If the file is a symbolic link, the retrieved file type and permissions correspond to those of the target file it references. | |
| FileStatus | SymlinkStatus (const Path &p) |
| Retrieve file type and permissions; This function can retrieve the type and permissions of the symbolic link file itself, distinct from its target file. | |
| bool | Exists (const FileStatus &s) noexcept |
| Check if a file exists. | |
| bool | Exists (const Path &p) |
| Check if a file exists. | |
| bool | Remove (const Path &p) |
| Remove a file. | |
| bool | RemoveProtectedFile (const Path &file_name) |
| Remove a protected file. | |
| uintmax_t | FileSize (const Path &p) |
| Check the size of the file. | |
| bool | IsDirectory (const FileStatus &s) noexcept |
| Check if the file is a directory. | |
| bool | IsDirectory (const Path &p) |
| Check if the file is a directory. | |
| bool | IsEmpty (const Path &p) |
| If the path is a directory, check whether it is empty; If the path is a regular file, check whether its size is 0. | |
| bool | IsRegularFile (const FileStatus &s) noexcept |
| Check if the file is a regular file. | |
| bool | IsRegularFile (const Path &p) |
| Check if the file is a regular file. | |
This module is designed to operate directly on files and directories in enclave.
|
strong |
The mode for file writing operation.
| Enumerator | |
|---|---|
| CreateNew | Specifies that the operating system should create a new file. If the file already exists, an FileSystemException exception is thrown. |
| OpenOrCreate | Specifies that the operating system should open a file if it exists; otherwise, a new file will be created. |
| Append | Opens the file if it exists and seeks to the end of the file, or creates a new file. |
|
strong |
File type enum.
|
strong |
File permissions (Octal)
| bool ssgx::filesystem_t::CreateDirectory | ( | const Path & | p | ) |
Create a directory (attribute default 0755)
| [in] | p | Dir path |
| FileSystemException |
|
noexcept |
Check if a file exists.
| [in] | s | File status |
| bool ssgx::filesystem_t::Exists | ( | const Path & | p | ) |
Check if a file exists.
| [in] | p | File path |
| FileSystemException |
| uintmax_t ssgx::filesystem_t::FileSize | ( | const Path & | p | ) |
Check the size of the file.
| [in] | p | File path |
| FileSystemException |
|
noexcept |
Check if the file is a directory.
| [in] | s | File status |
| bool ssgx::filesystem_t::IsDirectory | ( | const Path & | p | ) |
Check if the file is a directory.
| [in] | p | File path |
| FileSystemException |
| bool ssgx::filesystem_t::IsEmpty | ( | const Path & | p | ) |
If the path is a directory, check whether it is empty; If the path is a regular file, check whether its size is 0.
| [in] | p | Path |
| FileSystemException |
|
noexcept |
Check if the file is a regular file.
| [in] | s | File status |
| bool ssgx::filesystem_t::IsRegularFile | ( | const Path & | p | ) |
Check if the file is a regular file.
| [in] | p | File path |
| FileSystemException |
| bool ssgx::filesystem_t::Remove | ( | const Path & | p | ) |
Remove a file.
| [in] | p | File path |
| FileSystemException |
| bool ssgx::filesystem_t::RemoveProtectedFile | ( | const Path & | file_name | ) |
Remove a protected file.
| [in] | The | protected file name |
| FileSystemException |
| FileStatus ssgx::filesystem_t::Status | ( | const Path & | p | ) |
Retrieve file type and permissions; If the file is a symbolic link, the retrieved file type and permissions correspond to those of the target file it references.
| [in] | p | File path |
| FileSystemException |
| FileStatus ssgx::filesystem_t::SymlinkStatus | ( | const Path & | p | ) |
Retrieve file type and permissions; This function can retrieve the type and permissions of the symbolic link file itself, distinct from its target file.
| [in] | p | File path |
| FileSystemException |