You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/model/file.md
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ weight: 100
8
8
9
9
## read
10
10
11
-
`read(filepath: string) -> str`
11
+
`read(filepath: str) -> str`
12
12
13
13
Read the contents of the file `filepath` and return a string instance.
14
14
@@ -29,3 +29,15 @@ Return the root path of the current KCL module (kcl.mod file path or single \*.k
29
29
`workdir() -> str`
30
30
31
31
Return the path of the current working directory.
32
+
33
+
## exists
34
+
35
+
`exists(filepath: str) -> bool`
36
+
37
+
Whether this file path exists. Returns true if the path points at an existing entity. This function will traverse symbolic links to query information about the destination file.
38
+
39
+
## abs
40
+
41
+
`abs(filepath: str) -> str`
42
+
43
+
Returns the canonical, absolute form of the path with all intermediate components normalized and symbolic links resolved.
0 commit comments