# Programming Ruby 3.2 (5th Edition): B4.0 page 565, being managed

**URL:** <https://forum.devtalk.com/t/programming-ruby-3-2-5th-edition-b4-0-page-565-being-managed/114067>\
**Category:** PragProg Customers\
**Tags:** errata, book-programming-ruby-3-2-5th-edition\
**Created:** [25 June 2023 03:30 UTC](https://forum.devtalk.com/t/programming-ruby-3-2-5th-edition-b4-0-page-565-being-managed/114067 "2023-06-25T03:30:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BernardK](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@BernardK](https://forum.devtalk.com/u/BernardK)\
**Post date:** [25 June 2023 03:30 UTC](https://forum.devtalk.com/t/programming-ruby-3-2-5th-edition-b4-0-page-565-being-managed/114067/1 "2023-06-25T03:30:43Z")

</div>

@noelrappin

page 565, third paragraph : strange sentence

> None of these methods are dependent on the file name being managed actually existing in  
> the file system.

```auto
irb(main):156:0> File.basename("/aaa/bbb/ccc/code.rb")
=> "code.rb"
irb(main):157:0> File.dirname("/aaa/bbb/ccc/code.rb")
=> "/aaa/bbb/ccc"

```

So I understand that _ **none of these methods are dependent on the existence of a real file** _.

+++++ In ref\_io/filenames.rb there is twice the same line

```auto
File.dirname("/usr/pickaxe/ruby/code.rb", 2) # => "/usr/pickaxe"
File.dirname("/usr/pickaxe/ruby/code.rb", 2) # => "/usr/pickaxe"

```

---

<div class="post-metadata">

**Author:** ![noelrappin](https://forum.devtalk.com/user_avatar/forum.devtalk.com/noelrappin/32/481_2.png) [@noelrappin](https://forum.devtalk.com/u/noelrappin)\
**Post date:** [25 June 2023 15:09 UTC](https://forum.devtalk.com/t/programming-ruby-3-2-5th-edition-b4-0-page-565-being-managed/114067/2 "2023-06-25T15:09:46Z")

</div>

How do you like:

All these file names are just doing string manipulation, they are not dependent on the file name being managed actually existing in the file system.

---

<div class="post-metadata">

**Author:** ![BernardK](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@BernardK](https://forum.devtalk.com/u/BernardK)\
**Post date:** [25 June 2023 17:58 UTC](https://forum.devtalk.com/t/programming-ruby-3-2-5th-edition-b4-0-page-565-being-managed/114067/3 "2023-06-25T17:58:06Z")

</div>

_string manipulation_ is **good** , _being managed_ + _existing_ still sounds weird.

1. not dependent on the file name being managed by the file system
2. not dependent on the file name actually existing in the file system

Preference : 2, remove _being managed_.

---

<div class="post-metadata">

**Author:** ![BernardK](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@BernardK](https://forum.devtalk.com/u/BernardK)\
**Post date:** [25 June 2023 18:02 UTC](https://forum.devtalk.com/t/programming-ruby-3-2-5th-edition-b4-0-page-565-being-managed/114067/4 "2023-06-25T18:02:01Z")

</div>

Did you see

+++++ In ref\_io/filenames.rb there is twice the same line

---

<div class="post-metadata">

**Author:** ![BernardK](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@BernardK](https://forum.devtalk.com/u/BernardK)\
**Post date:** [18 July 2023 16:18 UTC](https://forum.devtalk.com/t/programming-ruby-3-2-5th-edition-b4-0-page-565-being-managed/114067/5 "2023-07-18T16:18:14Z")

</div>

@noelrappin

Not sure if you have received the two replies above.

---

<div class="post-metadata">

**Author:** ![noelrappin](https://forum.devtalk.com/user_avatar/forum.devtalk.com/noelrappin/32/481_2.png) [@noelrappin](https://forum.devtalk.com/u/noelrappin)\
**Post date:** [19 July 2023 03:08 UTC](https://forum.devtalk.com/t/programming-ruby-3-2-5th-edition-b4-0-page-565-being-managed/114067/6 "2023-07-19T03:08:51Z")

</div>

I have, thanks!
