FIFO special file 이 무엇인가요?
안녕하세요.
ls하면 prwxrwxrwx 형식을 가진 파일이 있습니다.
size 는 0이고요.
자료를 찾아보니 하기와 같습니다. 프로세스에서 동시에 읽고 쓸때 사용??
하지만 이해가 안되네요. 뭐할 때 사용하는 건가요? ^^;;
p Fifo (also called a "named pipe") special file
15.3 FIFO Special Files
A FIFO special file is similar to a pipe, except that it is created in a different way. Instead of being an anonymous communications channel, a FIFO special file is entered into the file system by calling mkfifo.
Once you have created a FIFO special file in this way, any process can open it for reading or writing, in the same way as an ordinary file. However, it has to be open at both ends simultaneously before you can proceed to do any input or output operations on it. Opening a FIFO for reading normally blocks until some other process opens the same FIFO for writing, and vice versa.
The mkfifo function is declared in the header file sys/stat.h.
— Function: int mkfifo (const char *filename, mode_t mode)
The mkfifo function makes a FIFO special file with name filename. The mode argument is used to set the file's permissions; see Setting Permissions.
The normal, successful return value from mkfifo is 0. In the case of an error, -1 is returned. In addition to the usual file name errors (see File Name Errors), the following errno error conditions are defined for this function:
EEXIST
The named file already exists.
ENOSPC
The directory or file system cannot be extended.
EROFS
The directory that would contain the file resides on a read-only file system.
IPC로 쓰입니다. named
IPC로 쓰입니다.
named pipe라고 불리는 녀석이며, pipe와 유사하게 사용하지만, open으로 파일을 여는것처럼 열어서 사용합니다.
두군데서 열면, A에서 쓰는 것이 B에서 읽힙니다.
pipe도 모르신다면 소켓을 생각하시면 됩니다.
언제나 삽질 - http://tisphie.net/typo/
프로그래밍 언어 개발 - http://langdev.net
언제나 삽질 - http://tisphie.net/typo/
프로그래밍 언어 개발 - http://langdev.net
^^
감사합니다. 윈도우의 shared memory나 메시지 큐 같은 개념의 것인가봅니다. (?!) ^^;;
댓글 달기