- Added
withTempDir— a helper that creates a temporary directory, passes it to a delegate, and automatically removes it when the delegate returns (or throws).
- Added
Path.movemethod that moves a path to a new destination. Attempts an atomic OS rename first; if source and destination are on different filesystems (EXDEVon Posix,ERROR_NOT_SAME_DEVICEon Windows) it falls back to a copy-then-delete. The copy is guarded by ascope(failure)that removes a partial destination on error.
- Fixed missing tilde (
~) expansion incopyFileTo(both source and destination paths),setAttributes,symlink, and thechownPosix syscall. - Fixed
chownwithrecursive=truere-walking already-visited subdirectories, causing O(n²) syscall count on deep trees. - Fixed wrong error message in
chown(username, groupname, ...): the group lookup failure now reports the group name instead of the user name. - Fixed
copyTo: format placeholder%sin theenforcemessage now receives the source path as its argument. - Removed spurious
returnon the voidstd.file.renamecall insiderename.
- Added
Path.homestatic func, that allows to get user's home directory on posix systems. - Auto
expandTildeonrealPathto avoid errors on attept toPath("~").realPath.
- Breaking! Changed signature for
chownmethod. now it receives one more argumentrecursivethat is placed beforefollowSymlink. Thus is may be incompatible with 1.x.x version
- Added new methods to
Pathstruct:driveNamethat returns Windows drive namestripDrivethat returns path without drive partstripExtthat returns path without extension
- Updated doc on
withExtmethod, to clarify differents wtihstd.path.withExtension.
- Added new method
chown
- Add tempFile static method that allows to open temporary files.
- Remove deprecated
executemethod. Use TheProcess instead
-
Added new param to
Path.parentmethod -absolute, that is by default set totrue(to keep backward compatibility). If this param is set tofalse, then path will not be converted to absolute path before computing parent path, thus it will be possible to get non-absolute parent path from non-absolute path. For example:Path("parent", "child").parent == Path.current.join("parent"); Path("parent", "child").parent(false) == Path("parent");