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
make sure we have:
doAssert lastPathPart(r"C:") == ""
doAssert lastPathPart(r"C:") == ""
doAssert extractFilename(r"C:") == ""
deprecate expandFilename : expandFilename doesn't just apply on files but also on dirs so it's badly named; also it's not as useful as realPath (cf unix cmd line realpath or python os.realpath):
in python, it resolves symlinks, makes it absolute dir, and doesn't throw on un-existant paths, instead resolves the maximum prefix then appends the suffix, eg:
Related pull requests: #6587 pull request to add normalizePath, absolutePath, but failed test and not merged. #8166 pull request to add getRelativePathFromAbsolute proc
=> use normalizePathEnd
recursive
argument toremoveDir
procedure [Improvement] [Issue 9200] Addrecursive
argument toremoveDir
procedure #9215joinPath("foo", "/bar")
should return "/bar"doAssert lastPathPart(r"C:") == ""
doAssert lastPathPart(r"C:") == ""
doAssert extractFilename(r"C:") == ""
expandFilename
: expandFilename doesn't just apply on files but also on dirs so it's badly named; also it's not as useful asrealPath
(cf unix cmd line realpath or python os.realpath):in python, it resolves symlinks, makes it absolute dir, and doesn't throw on un-existant paths, instead resolves the maximum prefix then appends the suffix, eg:
realpath
(seeunix realpath
; perhaps extracting that out from implementation offindExe
which may be doing that at the end)Related to that expandFilename works only on existing files and directories. #6486
which prog
see [TODO]findExe
should have an option to match unixwhich
(and pythonshutil.which
) behavior (cwd not searched, and by default symlinks not followed) #8311stat
(or pythonos.stat
, or D'sstd.file. DirEntry
)os.tailDir
fails on some paths #8395 ospaths:tailDir("/usr/local/bin")
should be "usr/local/bin" instead of "local/bin" (because of/
)os.tailDir
fails on some paths #8395see Add relativePath proc and test #8166 pull request to add
getRelativePathFromAbsolute
proc=> PR fix #8225 os.isHidden was buggy on posix #8315
extractFilename("usr/lib/")
should return "lib" (not "") and be calledbaseName
(since works with dirs) [RFC]extractFilename("usr/lib/")
should return "lib" (not "") and be calledbaseName
(since works with dirs) #8341 => see fix in PR fix #8341: add lastPathPart #9116ospaths.absolutePath
function to get absolute path from a path #8174 missingospaths.absolutePath
function to get absolute path from a path missingospaths.absolutePath
function to get absolute path from a path #8174EDIT PR: add os.absolutePath; fixes #8174 #8213
BUG: toSeq("foo/.".parentDirs) returns@["foo/.", "foo"]
instead of@["foo"]
; similarly confused with".."
in pathminor
getEnv
+ friends has nothing to do with ospaths, should be in a different module (imported by ospaths since it uses getHomeDir)EDIT see Add normalizePath and tests #6587 (comment) ; but should be in ospaths, not os; (see Add normalizePath and tests #6587 (review))
also, normalizedPath("/../../../") == "/" currently instead of throwing, not sure if desired (cf https://github.com/nim-lang/Nim/pull/6587/files#r200625795)
related
The text was updated successfully, but these errors were encountered: