---
title: "Comment by Olanrewaju Olamide on \"Building a simple shell in C - Part 4\" | Hashnode"
description: "Didn&#39;t occur to me that I could use the stat function to check if a file directory is valid."
url: "https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/6376643adc823473f485b65f"
---

[Discussion](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2)

Comment [Building a simple shell in C - Part 4](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2)

[Olanrewaju Olamide](https://hashnode.com/@Olyray)

[Nov 17, 2022](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/6376643adc823473f485b65f)

Didn't occur to me that I could use the stat function to check if a file directory is valid.

[Dr. Ehoneah Obed](https://hashnode.com/@ehoneahobed)

[Nov 19, 2022](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/6376643adc823473f485b65f#reply-6379458db1e7ce958945422b)

Now you know better. Try it out and see
