Fs
Custom types
FsMetadataResult
type FsMetadataResult is bytes32;
Structs
FsMetadata
struct FsMetadata {
bool isDir
bool isSymlink
uint256 length
bool readOnly
uint256 modified
uint256 accessed
uint256 created
}
Functions
Ok(FsMetadata value) → (FsMetadataResult)
fs
readFile(string path) → (StringResult)
Reads the file on path
and returns its content as a StringResult
.
readFileBinary(string path) → (BytesResult)
Reads the file on path
and returns its content as a BytesResult
.
projectRoot() → (StringResult)
Obtains the current project's root.
metadata(string fileOrDir) → (FsMetadataResult)
Obtains the metadata of the specified file or directory.
readLine(string path) → (StringResult)
Reads the next line of the file on path
.
writeFile(string path, string data) → (EmptyResult)
Modifies the content of the file on path
with data
.
writeFileBinary(string path, bytes data) → (EmptyResult)
Modifies the content of the file on path
with data
.
writeLine(string path, string data) → (EmptyResult)
Adds a new line to the file on path
.
closeFile(string path) → (EmptyResult)
Resets the state of the file on path
.
removeFile(string path) → (EmptyResult)
Deletes the file on path
.
copyFile(string origin, string target) → (EmptyResult)
Copies a file from origin
to target
.
moveFile(string origin, string target) → (EmptyResult)
Moves a file from origin
to target
.
fileExists(string path) → (BoolResult)
Checks if a file or directory exists.
getCode(string path) → (BytesResult)
Obtains the creation code from an artifact file located at path
getDeployedCode(string path) → (BytesResult)
Obtains the deployed code from an artifact file located at path