Path.swift

Delightful, robust, cross-platform and chainable file-pathing functions.

UNLICENSE License

Stars
946
Committers
6
Path.swift - 0.15.0

Published by mxcl over 5 years ago

Path.swift - 0.14.0

Published by mxcl over 5 years ago

Path.swift - 0.13.0

Published by mxcl over 5 years ago

Path.swift - 0.12.1

Published by mxcl over 5 years ago

Path.swift - 0.12.0

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)

Path.swift - 0.11.1

Published by mxcl over 5 years ago

Path.swift - 0.11.0

Published by mxcl over 5 years ago

Added rename

try Path.root.bar.rename("foo")
Path.swift - 0.10.0

Published by mxcl over 5 years ago

  • extension is now savvy to certain (hard-coded) double extensions, eg. .tar.gz
  • Added Entry.files so you can do:
for file in Path.root.ls().files {
    //…
}
Path.swift - 0.9.0

Published by mxcl over 5 years ago

Inlinable extensions for FileHandle.

Path.swift - 0.8.0

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.

Path.swift - 0.7.0

Published by mxcl over 5 years ago

Added dynamic-members, so you can do, eg.

try Path.home.Library.Preferences.foo.mkdir()
Path.swift - 0.6.0

Published by mxcl over 5 years ago

  • delete() is a noop if there is no file at that path
  • mkpath() removed, now mkdir() takes a mkdir(.p) option
Path.swift - 0.5.1

Published by mxcl over 5 years ago

Path.swift - 0.5.0

Published by mxcl over 5 years ago

  • Removed Path.replaceContents due to it violating the responsibility boundary of our library, use String.write instead
  • Swift 5 support.
  • We test against Swift 5 snapshots now.
Path.swift - 0.4.4

Published by mxcl almost 6 years ago

Path.swift - 0.4.3

Published by mxcl almost 6 years ago

Path.swift - 0.4.2

Published by mxcl almost 6 years ago

Path.swift - 0.4.1

Published by mxcl almost 6 years ago

ls can now ignore hidden files. Note: API will change in future releases.

Path.swift - 0.4.0

Published by mxcl almost 6 years ago

Added some more common directories, eg. Path.documents using the Free Desktop specification for Linux.

Path.swift - 0.3.0

Published by mxcl almost 6 years ago

Minor changes in behavior for Path.mtime, thus the minor bump.