File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ description : " Filesystem I/O and metadata operations."
3+ ---
4+
5+ # ` fs `
6+
7+ Filesystem I/O and metadata operations.
8+
9+ ## Usage
10+
11+ ``` lua
12+ fs = require " mods.fs"
13+
14+ fs .mkdir (" tmp/cache/app" , true )
15+ ```
16+
17+ ## Functions
18+
19+ | Function | Description |
20+ | ---------- | -------------------------------------------------- |
21+ | ` getcwd ` | Alias of ` lfs.currentdir ` |
22+ | ` isblock ` | Alias of [ ` mods.is.block ` ] ( /modules/is#fn-block ) |
23+ | ` ischar ` | Alias of [ ` mods.is.char ` ] ( /modules/is#fn-char ) |
24+ | ` isdevice ` | Alias of [ ` mods.is.device ` ] ( /modules/is#fn-device ) |
25+ | ` isdir ` | Alias of [ ` mods.is.dir ` ] ( /modules/is#fn-dir ) |
26+ | ` isfifo ` | Alias of [ ` mods.is.fifo ` ] ( /modules/is#fn-fifo ) |
27+ | ` isfile ` | Alias of [ ` mods.is.file ` ] ( /modules/is#fn-file ) |
28+ | ` islink ` | Alias of [ ` mods.is.link ` ] ( /modules/is#fn-link ) |
29+ | ` issocket ` | Alias of [ ` mods.is.socket ` ] ( /modules/is#fn-socket ) |
30+ | ` lstat ` | Alias of ` lfs.symlinkattributes ` |
31+ | ` rmdir ` | Alias of ` lfs.rmdir ` |
32+ | ` stat ` | Alias of ` lfs.attributes ` |
Original file line number Diff line number Diff line change 1+ ---
2+ description : " Lexical path operations for Windows/NT-style paths."
3+ ---
4+
5+ # ` ntpath `
6+
7+ Lexical path operations for Windows/NT-style paths.
8+
9+ > 💡Python ` ntpath ` -style behavior, ported to Lua.
10+
11+ ## Usage
12+
13+ ``` lua
14+ ntpath = require " mods.ntpath"
15+
16+ print (ntpath .join ([[ C:\]] , " Users" , " me" )) -- > "C:\Users\me"
17+ print (ntpath .normcase ([[ A/B\C]] )) -- > [[a\b\c]]
18+ print (ntpath .splitdrive ([[ C:\Users\me]] )) -- > "C:", [[\Users\me]]
19+ print (ntpath .isreserved ([[ C:\Temp\CON.txt]] )) -- > true
20+ ```
21+
22+ > ✨ Same API as [ ` mods.path ` ] ( /modules/path ) , but with Windows/NT path
23+ > semantics.
24+
25+ ## Functions
26+
27+ <a id =" fn-ismount " ></a >
28+
29+ ### ` ismount(path) `
30+
31+ Return ` true ` when ` path ` points to a mount root.
32+
33+ ** Parameters** :
34+
35+ - ` path ` (` string ` ): Path to inspect.
36+
37+ ** Return** :
38+
39+ - ` value ` (` boolean ` ): ` true ` if the path resolves to a mount root.
40+
41+ ** Example** :
42+
43+ ``` lua
44+ ntpath .ismount ([[ C:\]] ) -- > true
45+ ```
46+
47+ <a id =" fn-isreserved " ></a >
48+
49+ ### ` isreserved(path) `
50+
51+ Return ` true ` when ` path ` contains a reserved NT filename.
52+
53+ ** Parameters** :
54+
55+ - ` path ` (` string ` ): Path to inspect.
56+
57+ ** Return** :
58+
59+ - ` value ` (` boolean ` ): ` true ` if any component is NT-reserved.
60+
61+ ** Example** :
62+
63+ ``` lua
64+ ntpath .isreserved ([[ a\CON.txt]] ) -- > true
65+ ```
You can’t perform that action at this time.
0 commit comments