On 28 December 2011 20:23, Matthew D. Gutchess wrote: > (2) In the sample program below, using fgets() instead of gets() results in a "No such file or directory error", but the program would open and display the file when gets() was used. Is this because fgets() appends "/0" to the entered file name and this must be stripped off? No, the '\0' added by fgets is necessary. Change the line that prints out the filename like so and you should see the problem: printf("You entered '%s' ", pathname); If that doesn't help, read the man page for fgets which is quite clear about its behaviour.