Updated the code example in the os module to use better grammar. (#12328)
This commit is contained in:
parent
c20778d2d3
commit
0d94ee15c0
1 changed files with 12 additions and 11 deletions
|
|
@ -15,19 +15,20 @@
|
||||||
## import os
|
## import os
|
||||||
##
|
##
|
||||||
## let myFile = "/path/to/my/file.nim"
|
## let myFile = "/path/to/my/file.nim"
|
||||||
##
|
##
|
||||||
## let splittedPath = splitPath(myFile)
|
## let pathSplit = splitPath(myFile)
|
||||||
## assert splittedPath.head == "/path/to/my"
|
## assert pathSplit.head == "/path/to/my"
|
||||||
## assert splittedPath.tail == "file.nim"
|
## assert pathSplit.tail == "file.nim"
|
||||||
##
|
##
|
||||||
## assert parentDir(myFile) == "/path/to/my"
|
## assert parentDir(myFile) == "/path/to/my"
|
||||||
##
|
##
|
||||||
## let splittedFile = splitFile(myFile)
|
## let fileSplit = splitFile(myFile)
|
||||||
## assert splittedFile.dir == "/path/to/my"
|
## assert fileSplit.dir == "/path/to/my"
|
||||||
## assert splittedFile.name == "file"
|
## assert fileSplit.name == "file"
|
||||||
## assert splittedFile.ext == ".nim"
|
## assert fileSplit.ext == ".nim"
|
||||||
##
|
##
|
||||||
## assert myFile.changeFileExt("c") == "/path/to/my/file.c"
|
## assert myFile.changeFileExt("c") == "/path/to/my/file.c"
|
||||||
|
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
## **See also:**
|
## **See also:**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue