# Question about File.chown

**URL:** <https://forum.crystal-lang.org/t/question-about-file-chown/5302>\
**Category:** Help & Support\
**Created:** [January 27, 2023, 4:50pm UTC](https://forum.crystal-lang.org/t/question-about-file-chown/5302 "2023-01-27T16:50:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fulgurance](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/fulgurance/32/1463_2.png) [@Fulgurance](https://forum.crystal-lang.org/u/Fulgurance)\
**Post date:** [January 27, 2023, 4:50pm UTC](https://forum.crystal-lang.org/t/question-about-file-chown/5302/1 "2023-01-27T16:50:40Z")

</div>

Hi, I would like to know if there is a way in Crystal to change the owner with the name?

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [January 27, 2023, 5:13pm UTC](https://forum.crystal-lang.org/t/question-about-file-chown/5302/2 "2023-01-27T17:13:03Z")

</div>

As far as I know, not directly. But you could use [System::Group - Crystal 1.7.2](https://crystal-lang.org/api/System/Group.html) and [System::User - Crystal 1.7.2](https://crystal-lang.org/api/System/User.html) to handle looking up their ID based on name. Maybe a `.chown` (and prob related methods) could have an overload that accepts `String` names and does it for you. I did a quick look and didn’t see any exists tickets about it at least.

---

<div class="post-metadata">

**Author:** ![Fulgurance](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/fulgurance/32/1463_2.png) [@Fulgurance](https://forum.crystal-lang.org/u/Fulgurance)\
**Post date:** [January 27, 2023, 6:50pm UTC](https://forum.crystal-lang.org/t/question-about-file-chown/5302/3 "2023-01-27T18:50:15Z")

</div>

Oh nice thanks !

Last question, is it possible to use this syntax as well with Crystal?  
**Example:**

```auto
chmod u+w

```
