Skip to content

Commit bd533b5

Browse files
authored
chore: add fsMetadata cheat (#251)
1 parent c725d45 commit bd533b5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Vm.sol

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ interface VmSafe {
2121
string url;
2222
}
2323

24+
struct FsMetadata {
25+
bool isDir;
26+
bool isSymlink;
27+
uint256 length;
28+
bool readOnly;
29+
uint256 modified;
30+
uint256 accessed;
31+
uint256 created;
32+
}
33+
2434
// Loads a storage slot from an address (who, slot)
2535
function load(address, bytes32) external view returns (bytes32);
2636
// Signs data, (privateKey, digest) => (v, r, s)
@@ -95,6 +105,8 @@ interface VmSafe {
95105
function readFileBinary(string calldata) external view returns (bytes memory);
96106
// Get the path of the current project root
97107
function projectRoot() external view returns (string memory);
108+
// Get the metadata for a file/directory
109+
function fsMetadata(string calldata fileOrDir) external returns (FsMetadata memory metadata);
98110
// Reads next line of file to string, (path) => (line)
99111
function readLine(string calldata) external view returns (string memory);
100112
// Writes data to file, creating a file if it does not exist, and entirely replacing its contents if it does.

0 commit comments

Comments
 (0)