Comments (5)
My opinion would be "yes", since I just got bit by this migrating from File::Path (using make_path) to Path::Tiny.
from path-tiny.
Either rename mkpath
or rename remove_tree
to rmtree
. I like mktree | rmtree
better because it's more concise, but it requires renaming both methods. Also you should not worry too much about mapping Path::Tiny method names to File::Path function names, because they are called differently anyway.
from path-tiny.
I like make_path
. You can keep mkpath
for compatibility (either with older versions of Path::Tiny
or with File::Spec
), and possibly remove later.
from path-tiny.
Possibly, it should be "make_tree" for proper parallelism.
They are not parallels though: remove_tree
really does remove an entire tree, whereas it‘s odd to call foo/bar/baz/quux
a “tree”. It’s just a single chain of subdirectories… basically, well, a path. So in that respect the names seem fine to me.
For me it’s the remove_tree
name I don’t like: it seems needlessly verbose. I would favour renaming that one to rmtree
(while leaving an alias in place essentially forever yada backcompat yada). I’ve rewritten some shell scripts in Perl with the aid of Path::Tiny before and the fact I had to spell out remove_tree
over and over in densely FS-modifying code was irritating (to read, not just write).
Or possibly both synonyms for both of the methods should go in? I can see that spelling things out in less dense code looks nicer, and the code-wise cost of aliases is trivial. So the question is, do they increase the burden on the maintenance programmer later… on which I learn towards no.
from path-tiny.
mkpath
was deprecated in 0.125
from path-tiny.
Related Issues (20)
- RFC: `with( $callback )` method HOT 1
- Tests fail on Windows 11: Failed test 'lstat' ... Error resolving realpath HOT 2
- mkdir fails if the directory exists HOT 1
- Broken tilde expansion for home directories of accounts with special characters HOT 1
- Windows 11: Failed test 'lstat' at t\filesystem.t line 420 (lstat->size returns zero) HOT 1
- Windows 11: Failed test 'relative symlinks with updir' at t/symlinks.t line 31. HOT 1
- Windows 11: Failed test 'Follow symlinks' at t/recurse.t line 139 HOT 1
- t/basic.t fails with ~root = / HOT 9
- Windows 11: Failed test "relative on absolute paths with symlinks" in t/rel-abs.t
- Feature request: $path->children('*.txt') or $path->glob('*.txt')
- A File::Temp object is created as an opened file, but the cached_temp is not open HOT 1
- Feature request: slurp_* support for chomp argument
- RFE: copy() & move() on existing Path::Tiny file object: return existing object
- Windows 11 fails test t/basic.t
- Feature Request: limit path->lines result to those matching pattern HOT 2
- Feature Request: integrate functionality of File::pushd
- Add is_temp, is_tempfile and is_tempdir predicates
- Support size option for digest to limit to first n bytes HOT 1
- Misleading error message for spew in non-existent dir HOT 10
- Adding 'dot' child
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from path-tiny.