README.md

pathr

Port of Python's os.path module to R. The aim is a fairly faithful transliteration with minimal extra features except for vectorisation and error handling. That way, anyone familiar with the Python module can immediately start using the package.

On the other hand, there is sufficient semantic gap between python and R that a direct transliteration could be confusing for users. Vectorisation and missing value handling for example are totally different, and need to be handled consistently.

Then there are things like commonprefix that are basically broken in Python that we'd probably want to implement a fixed version of. And there are behaviours in normcase/normpath that we'd possibly not want to mimic exactly (such as changing slack direction and not correcting case on macOS).

Status

The names here (immediately by the checkboxes) are the python names for the functions

The python module also provides constants

But it's not clear how these should be provided. I'd think that upper-case would be more typical for R? (e.g., pathr::CURDIR)

Design

In the Python implementation, POSIX and Windows paths are treated separately. We want to continue this, but (to the extent that things don't rely on calling back to the underlying OS) allow path manipulations to simulate a different operating system (so while on Linux, construct and manipulate windows paths). I'm not sure how best to expose this

Unlike the python version, I think that something that recognises that path handling is different on OSX to traditional POSIX would be useful (particularly around handling of normalised cases, given that OSX is case insensitive but case preserving). Windows is similar in this regard, so I'll need to work that logic through anyway.

Documentation

Every file should have a section indicating which python function they are descended from and how they differ

Should also document if they can be made to work on the other platform (i.e., where we are using OS-level tools vs plain path calculations).

Other

Extensions

Work still needed



richfitz/pathr documentation built on May 27, 2019, 8:22 a.m.