question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Absolute child is error prone

See original GitHub issue

“append” an absolute child is error prone, and not consistent with Bash.

import better.files._
import better.files.File.home

val bashrc = home / ".bashrc"    
// --> /home/user/.bashrc

val bashrcBak = file"/tmp/aBackupDir" / (bashrc.pathAsString + ".bak")
// --> /home/user/.bashrc.bak
// Not /tmp/aBackupDir//home/user/.bashrc.bak
// Not /tmp/aBackupDir/home/user/.bashrc.bak

With Bash : /tmp/aBackupDir//home/user/.bashrc.bak

$ cat "/tmp/aBackupDir"/"/home/user/.bashrc.bak"
cat: /tmp/aBackupDir//home/user/.bashrc.bak: No such file or directory

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pathikritcommented, Nov 10, 2016

I think we need to implement a typed path for relative and absolute paths to prevent stuff like this

0reactions
jvicancommented, Mar 8, 2017

Aha, so you already did! @jaa127 😉

Cool to see this merged. We have some other issues that you may want to play around with – we’re currently trying to prepare for a release in the Scala Platform, the next community-maintained Scala library that will replace the current standard library in 2.13.

Read more comments on GitHub >

github_iconTop Results From Across the Web

css - parent's position is absolute and child's ... - Stack Overflow
If the parent is absolute and child relative : they are bound. the child moves ( width and height ) towards or away...
Read more >
The Competing Principles of Child Protection - Evident Change
Too often, accounts from the media characterize caseworkers as either biased baby snatchers or error-prone bureaucrats who miss red flags.
Read more >
Absolute Percent Errors for the Child Woman Ratio. The ...
We show that even the simplest and least accurate variant has a median error of only 0.09 births per woman over 2,400 fertility...
Read more >
How can I contain these children.. absolute and relative ...
I'm trying to get #relative_test2 to contain it's children #test2 and #test3. Overflow:hidden didn't work, evidently that is just for floats.
Read more >
Hyperopia - StatPearls - NCBI Bookshelf
For children with refractive error only, proper refractive correction is indicated. If amblyopia development is suspected, orthoptic exercises ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found