3 ms·
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 a
by herpderperator 7y ago
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 https://en.wikipedia.org/wiki/Everything_is_a_file
[1] https://elixir.bootlin.com/linux/latest/source/include/uapi/asm-generic/errno-base.h#L21 https://elixir.bootlin.com/linux/latest/source/include/uapi/...