正在加载图片...
文件系统系统调用实例(1) /* File copy program. Error checking and reporting is minimal. * #include <sys/types. h> /* include necessary header files * #include <fcntl. h> #include <stdlib. h> #include <unistd. h> int main(int argc, char *argu); /★ANS| prototype* #define BUF SIZE 4096 /* use a buffer size of 4096 bytes *y #define OUTPUT MODE 0700 / protection bits for output file int main(int argc, char *argil int in fd. out fd. rd count wt count char buffer[BUFS忆zE; (argc != 3)exit(1) / syntax error if argc is not 3 */ /* Open the input file and create the output file *y in_fd= open(argv[1],O_RDONLY open the source file * if (in_fd <O)exit(2); /* if it cannot be opened exit * out_ fd= creat(argv[2], OUTPUT MODE);/* create the destination file * if (out fd <O)exit(3); /* if it cannot be created. exit *. . . 文件系统系统调用实例(1)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有