|
- #include <stdio.h>
- #include <stdlib.h>
- int main( void )
- {
- FILE *fp;
- int c;
- fp = fopen( "/root/fstab", "r" );
- if( fp != NULL ) {
- c = fgetc( fp );
- if( ferror( fp ) ) {
- printf( "Error reading file\n" );
- }
- }
- fclose( fp );
- return EXIT_SUCCESS;
- }
复制代码
能在RedHat 9通过,在BSD应该怎么写? |
|