dagolden / Path-Tiny

File path utility
41 stars 59 forks source link

Adding 'dot' child #293

Open nataraj-hates-MS-for-stealing-github opened 3 months ago

nataraj-hates-MS-for-stealing-github commented 3 months ago

Not sure it worth fixing, but still I will mention it.

There are rare cases when you need dot at the end of the path. Eg: cp -R /home/nataraj/. /mnt/my_home_backup will copy all files and dirs in my home forlder, including hidden one. If I omit the dot, the whole home folder will be copied.

but when I do $home=path($home).child('.') in Path::Tiny, the dot is omitted.

I do not know what logic about the dots is under the hood, but I guess when use explicitly want dot-child, we should allow it.

But still it is not an issue of great importance, it is quite rare, and can be easily worked around.