# \[QP2\]\[C\] Builtin completion

**URL:** <https://forum.codecrafters.io/t/qp2-c-builtin-completion/4919>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [February 16, 2025, 2:53pm UTC](https://forum.codecrafters.io/t/qp2-c-builtin-completion/4919 "2025-02-16T14:53:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Treeesk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/treeesk/32/4693_2.png) [@Treeesk](https://forum.codecrafters.io/u/Treeesk)\
**Post date:** [February 16, 2025, 2:53pm UTC](https://forum.codecrafters.io/t/qp2-c-builtin-completion/4919/1 "2025-02-16T14:53:53Z")

</div>

Hello, I have encountered an error, which I will attach below. My github code: [GitHub - Treeesk/codecrafters-shell-c](https://github.com/Treeesk/codecrafters-shell-c) . I added keystroke processing using termios.h. After that, errors started appearing on tests that used to work, I don’t quite understand where exactly the error appeared. As I understand it, it doesn’t even reach the deadline from 2\>\>, and the error appears after the first line entered.

```auto
remote: [your-program] $ ls -1 nonexistent >> /tmp/quz/baz.md
remote: [your-program] ls: nonexistent: No such file or directory
remote: [tester::#UN3] ✓ Received error message
remote: [tester::#UN3] ✓ File: /tmp/quz/baz.md is empty
remote: [your-program] $ ls -1 nonexistent 2>> /tmp/quz/qux.md
remote: [tester::#UN3] Expected prompt ("$ ") but received ""
remote: [your-program] execv: Permission denied
remote: [your-program] $
remote: [tester::#UN3] Assertion failed.
remote: [tester::#UN3] Test failed

```

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [February 16, 2025, 6:29pm UTC](https://forum.codecrafters.io/t/qp2-c-builtin-completion/4919/2 "2025-02-16T18:29:49Z")

</div>

I’ll take a look and get back to you early next week.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [February 17, 2025, 8:22am UTC](https://forum.codecrafters.io/t/qp2-c-builtin-completion/4919/4 "2025-02-17T08:22:32Z")

</div>

Hi @Treeesk, it looks like `check_path` isn’t working as expected:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/3/37c06a9e0efe89ebab88006f8a3ed1650a2b32b3.png)

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/d/df065693043477720a5b4a987aee41b6d313e226.png)

The `execv: Permission denied` error occurs because execv is attempting to execute programs with invalid paths.

---

<div class="post-metadata">

**Author:** ![Treeesk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/treeesk/32/4693_2.png) [@Treeesk](https://forum.codecrafters.io/u/Treeesk)\
**Post date:** [February 17, 2025, 8:36am UTC](https://forum.codecrafters.io/t/qp2-c-builtin-completion/4919/6 "2025-02-17T08:36:05Z")

</div>

And what exactly is wrong with the path? I don’t quite understand why this error appeared before I added termios.h everything worked. I added debugging information and the path to the path was duplicated.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/1/1d319443b77e0ca194dff65b6f85288d64cba3b9.png)

```auto
remote: [your-program] $ ls -1 nonexistent 2>> /tmp/bar/foo.md
remote: [your-program] execv: Permission denied
remote: [tester::#UN3] Expected prompt ("$ ") but received "execv: Permission denied"
remote: [your-program] /tmp/grape/raspberry/strawberry//tmp/grape/raspberry/strawberry/$
remote: [tester::#UN3] Assertion failed.

```

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [February 18, 2025, 3:57pm UTC](https://forum.codecrafters.io/t/qp2-c-builtin-completion/4919/9 "2025-02-18T15:57:13Z")

</div>

@Treeesk Looks like you’ve got past this stage. Do you happen to remember what was wrong? Would love to see if we can improve the tester / instructions.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [February 23, 2025, 3:57pm UTC](https://forum.codecrafters.io/t/qp2-c-builtin-completion/4919/11 "2025-02-23T15:57:44Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
