Compare commits

..

2 Commits

Author SHA1 Message Date
brent saner bbb7982f46 v1.16.5
FIXED:
* paths.IsDirOrLinkDir had a bad call to paths.RealPathExistsStatTarget
  (missing the relRoot param)
2026-07-24 17:09:55 -04:00
brent saner 8f1fca839c v1.16.4
ADDED:
* paths:
** IsDirOrLinkDir
2026-07-17 17:22:03 -04:00
+23
View File
@@ -161,6 +161,29 @@ func GetFirstWithRef(p []string) (content []byte, isDir, ok bool, idx int) {
return return
} }
/*
IsDirOrLinkDir returns true if path p is a directory OR a symlink to a directory.
isDir will be true if p is either a directory or a symlink directory
(symlinks are followed and recursed).
isLink will only be true if p is a symlink to a directory (or a symlink to a symlink
to a directory, etc.).
*/
func IsDirOrLinkDir(p string) (isDir, isLink bool, err error) {
var stat fs.FileInfo
var pTmp string = p // avoid weird runtime-y race-y things
if _, _, isLink, _, stat, err = RealPathExistsStatTarget(&pTmp, ""); err != nil {
return
}
isDir = stat.IsDir()
return
}
/* /*
Len returns the number of path segments in p, as split with the same param signature to [Segment]. Len returns the number of path segments in p, as split with the same param signature to [Segment].