Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, in Unix, everything is a file[0], even directories. So when I mentioned filenames, this includes directories. :-)

As a real-world example for those who are curious, running mkdir twice yields errno 17, EEXIST, which is "File exists"[1]:

  root@vbox:~# mkdir directory
  root@vbox:~# mkdir directory
  mkdir: cannot create directory ‘directory’: File exists
But sure, the fast way could be mostly right, and maybe your goal is to just get it done and not get better at these tools, in which case, sure.

[0] https://en.wikipedia.org/wiki/Everything_is_a_file

[1] https://elixir.bootlin.com/linux/latest/source/include/uapi/...



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: