mxcl / Path.swift

Delightful, robust, cross-platform and chainable file-pathing functions.
The Unlicense
946 stars 36 forks source link

[Feature request] Add .read_text() and read_bytes() #52

Closed korakot closed 5 years ago

korakot commented 5 years ago

Python's pathlib has them since version 3.5 It will make reading text much easier.

mxcl commented 5 years ago

We provide convenience functions for Data.init and String.init why are these not sufficient?

korakot commented 5 years ago

At first, I didn't see it in the examples. They should be good enough. But I still prefer read_text() where you can chain the methods in logical order (you go into a directory, reach a file, then read its text.)

mxcl commented 5 years ago

We offer chaining for file system operations, and extensions for Apple API that takes string paths for the rest. I'd be convinced by a good example though.