/*
* made by so_Sal
*/
The programming of Basic file system-call.
1st
Input file name, and make file.
Save the content written by user in the file.
If user enter the buffer “The end”, then end the program.
2nd
Input 2 files name, and make file1, file2.
Save the content written by user in the file.
If user enter the buffer “The end”, then end the program.
Append the content on the file2.
Repeat 1-4 level. ( quit option added in level1.)
- Assignment 1.
The source code of program.
fcntl.h : Header file
To use file system call.
Open( buffer, O_WRONLY | O_CREAT, 00644);
File name: contents of ‘buffer’.
FD attribute: O_WRONLY,O_CREAT
only writing mode.
unless file exists, make the new file.
Permission: r w - | r - - | r - -
write( fd, buffer, strlen(buffer));
Write contents of the buffer on the file which 'fd' point
Assignment 2
Source code, and annotation.
Rewind : return FD to fisrt side of file
Memset : Initialize the buffer.
'Major Study. > Computer Science' 카테고리의 다른 글
DSP - Sampling과 Aliasing (0) | 2014.07.17 |
---|---|
Multithreading models, 스레드의 개념 (0) | 2014.07.17 |
Operating system. 운영체제의 기본 개념 (0) | 2014.07.17 |
데이터베이스 DBMS 시스템 개요, 개념 (0) | 2014.07.17 |
DBMS 기본 DB 개념 및 용어 (0) | 2014.07.17 |