Tester not creating file? http server #AP6

hi,
so as the title says theres nothing created on the tmp folder-- /tmp/data/codecrafters.io/http-server-tester/ from the tester logs – my files and repository are on windows file system, Im doing the challenge on the windows subsystem for linux, so Im using this string in the code to locate the file
“~/…/…/tmp/data/codecrafters.io/http-server-tester/%s”
I suspect the repo’s location is the issue, I could share code if that helps.

thanks

Are pulling the path from the url?

You should be able to pass in the directory to program and then append the file name to the directory.

I’m also fairly certain that the path should be relative not absolute so the temp folder should be in your project directory, not in the root

hey
yeah I first tried with a tmp folder in the project directory but didnt work.
not sure I understand your question, but I got the path from the tester logs, so I assumed that’s where files are created:

  • $ ./your_program.sh --directory /tmp/data/codecrafters.io/http-server-tester/
  • Testing existing file
  • Creating file raspberry_pineapple_raspberry_orange in /tmp/data/codecrafters.io/ http-server-tester/

also there’s a single “apple_pear_orange_pineapple” file in /tmp but using “~/…/…/tmp/%s” doesnt work either

hey there

resolved the issue by creating tmp/data/codecrafters.io/http-server-tester/ folders on the project’s directory (before, I only created tmp)
also in the code, changed the fopen mode “w+” for “rb” . Im doing the challenge in C

also OT, but I thought the project would be pushed to my own github, am I missing something?

You have to explicitly push the code to your Github project. If you’re familiar with Github, you can create your new repo, set up a new remote, and push your code to the new remote.

You can also click your project, select Publish to Github and follow the instructions there:

image

2 Likes