is there a unix command to tell whether or not a file is in a directory?
is there a unix command to tell whether or not a file is in a directory?
Yes.
Now do you mean via the shell, or in a C program?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
i mean in a c program
Well you could just try
And see if it succeeds or not.Code:FILE *fp = fopen( "/path/to/file.txt", "r" );
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
If you are the curious sort, you might try the man page for fopen and perhaps for the sytem call open.