title: Does a file need an extension to be opened with open() in C/C++?
body: <p>I'm writing a program using Xcode for school that requires we use the open() system call.  I do<br>
  <code>int input_file_desc = open(input_path, O_RDONLY);</code><br>
  <code>printf("input file desc %d:\n", input_file_desc);</code></p>
  
  <p>and it comes up with a -1.  The file's path is ~/data_to_read.  I set up the command line arguments in xcode.  <code>input_path</code> is a <code>const char *</code> that i get from the command line.  For some reason it works fine if I change the filename and command line argument to ~/data_to_read.txt.  Let me know if more info is needed. thanks.</p>
  
  <p>EDIT:  I only tried it with .txt to see if that was the problem, but I still don't know why it needs an extension in the first place.  You can have files without an extension right?  In which case it should still work, as long as neither the file path nor the argument has an extension, right?</p>