0

I'm recoding ls in C, and while testing for possible weird behaviours I ran into this:

when I try to run the systems ls with the argument "" I get

*****s-MacBook-Pro:Documents ****$ ls ""
ls: fts_open: No such file or directory

I'm running OS X and I can't find any files named fts_open anywhere, and the only this I could find related to it is that fts_open is a UNIX command. What is the reason for that behaviour? Is it OS X specific? thanks

Fabio
  • 3,015
  • 2
  • 29
  • 49
  • You're saying you've written your own `ls`? Maybe you end up referencing an undefined string? – that other guy Jun 05 '15 at 01:58
  • @thatotherguy no, that actually happens with the systemss ls – Fabio Jun 05 '15 at 01:59
  • @4ae1e1 It's the systems ls that's doing that, not mine. furthermore, you can see here http://stackoverflow.com/questions/15892722/execvp-ls-fts-open-no-such-file-or-directory that other people are encountering the same behaviour – Fabio Jun 05 '15 at 02:02
  • Yes, I temporarily forgot I was using GNU ls all along. BSD ls does have that problem. – 4ae1e1 Jun 05 '15 at 02:03
  • If you are really interested you can look at the source code. I won't bother to. It's just meaningless error message for invalid input, and no one is supposed to parse that tty error message programmatically anyway. – 4ae1e1 Jun 05 '15 at 02:06
  • 1
    The suggests duplicate mentions the same behavior but does not attempt to answer this question – that other guy Jun 05 '15 at 05:32

0 Answers0