So I'm having some weird problems calling ls on directories.
My code works when I call: ./a.out bin -l (or any other flags/combinations of flags)
But when I JUST call: ./a.out bin, I get the correct output, but with a few added error messages:
Here is my output when I call ./a.out bin
Error with stat: No such file or directory
Error with readdir: No such file or directory
Error with readdir: No such file or directory
rshell
Here is the correct output (ls bin)
rshell
So as you can see, mine outputs rshell in the end, but has three error messages that comes with it. And when I append flags, in any combination, any flags, any order, those error messages no longer occur.
So I'm having some weird problems calling ls on directories.
My code works when I call: ./a.out bin -l (or any other flags/combinations of flags)
But when I JUST call: ./a.out bin, I get the correct output, but with a few added error messages:
Here is my output when I call ./a.out bin Error with stat: No such file or directory Error with readdir: No such file or directory Error with readdir: No such file or directory rshell
Here is the correct output (ls bin) rshell
So as you can see, mine outputs rshell in the end, but has three error messages that comes with it. And when I append flags, in any combination, any flags, any order, those error messages no longer occur.