Published by mxcl over 5 years ago
Published by mxcl over 5 years ago
Published by mxcl over 5 years ago
Published by mxcl over 5 years ago
Published by mxcl over 5 years ago
Many fixes due to increasing our code coverage
mtime
/ctime
return nil
now instead of UNIXTimeZero since Linux often has no mtime
and chaining the times to get one you want is more explicit:
foo.mtime ?? foo.ctime ?? Date(timeIntervalSince1970: 0)
Published by mxcl over 5 years ago
Published by mxcl over 5 years ago
Added rename
try Path.root.bar.rename("foo")
Published by mxcl over 5 years ago
extension
is now savvy to certain (hard-coded) double extensions, eg. .tar.gz
Entry.files
so you can do:for file in Path.root.ls().files {
//β¦
}
Published by mxcl over 5 years ago
Inlinable extensions for FileHandle
.
Published by mxcl over 5 years ago
Bundle functions all return Path
, not Path?
.
Rationale: Paths are not guaranteed to exist, the Bundle functions return optional if the path doesn't exist. So we'll provide a sensible default instead and you need to check the result exists at some point instead.
This makes more elegant chains, the chain will fail when you operate on it, but you donβt have to do a check for optional first. Or risk a bang.
Published by mxcl over 5 years ago
Added dynamic-members, so you can do, eg.
try Path.home.Library.Preferences.foo.mkdir()
Published by mxcl over 5 years ago
delete()
is a noop if there is no file at that pathmkpath()
removed, now mkdir()
takes a mkdir(.p)
optionPublished by mxcl over 5 years ago
Published by mxcl over 5 years ago
Path.replaceContents
due to it violating the responsibility boundary of our library, use String.write
insteadPublished by mxcl almost 6 years ago
Published by mxcl almost 6 years ago
Published by mxcl almost 6 years ago
Published by mxcl almost 6 years ago
ls can now ignore hidden files. Note: API will change in future releases.
Published by mxcl almost 6 years ago
Added some more common directories, eg. Path.documents
using the Free Desktop specification for Linux.
Published by mxcl almost 6 years ago
Minor changes in behavior for Path.mtime
, thus the minor bump.