Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

프로세스간 stdin 전달하는 방법??

6 views
Skip to first unread message

demiahn

unread,
May 26, 2009, 4:15:07 AM5/26/09
to
�Ʒ��� ���� stdin���κ����� �Է��� �޾� ó���ϴ� ���μ��� A�� �ֽ��ϴ�.
while (1) {
readn = (int) getline(&buf, &n, stdin);
/* ... */
}

���μ��� B���� ���ΰԽ� A�� stdin���� ���ڿ��� ������ ������,
��� �ϸ� �dz���?
��, ���μ��� A�� ���� stdin�� �ƴ϶� ���μ��� B�κ��� ��޵Ǵ� ���ڿ���
ó���ϰ� �ϰ� �ͽ��ϴ�.


Chong-Dae Park

unread,
May 28, 2009, 3:14:15 AM5/28/09
to

pipe�� socket�� �̿��ϸ� �˴ϴ�.

B | A

������ shell���� �ϴ� �Ͱ� �������� �Ϸ��� popen system call��
�����մϴ�.

popen ��� �Ŵ����� ���캸����.

--
������
--
"Perfection is achieved, not when there is nothing more to add,
but when there is nothing left to take away"
- Antoine de Saint-Exupery

demiahn

unread,
May 28, 2009, 9:12:14 PM5/28/09
to
B | A
�̰���, B�� ����� �Ŀ� �� ��� output�� A�� input���� ��޵˴ϴ�.
���� ���ϴ� ���� A�� B�� ���ÿ� ���� �ǰ� �ִ� ���¿���
B�� A�� stdin���� ���𰡸� ����� �� �ִ� ����� �ִ��Ĵ� ���Դϴ�.

��ü������ �����帮��,
���� ��Ʈ�ʾ�ü�κ��� ���α׷�(Console�κ��� ���𰡸� ó���ϴ� ���α׷�)��
�޾Ҵµ�
�� ���α׷��� ���� �׽�Ʈ�� �ؾ� �մϴ�.
�׷��� �Ź� Console�� ����� �������� �ϴ� �ʹ� �����ؼ�(��ð� �׽�Ʈ �ʿ�)
(������� ����ϳ� ������ 1�� �Ŀ� ���� ����� ������ �ϴ� ���,,,)
�� ���α׷��� �׽�Ʈ�ϴ� ���α׷��� ������� �ϴ� ���Դϴ�.
��, ��Ʈ�� ��ü�κ��� ���� ���α׷��� ������ ���� ��� �����̰�,
(���� �ҽ��� �ֱ� ������ �־��� ��찡 �ƴ϶�� �ǵ��� �������� �������� ��)
������ ���α׷��� ����� �� ���α׷��� stdin���� �׽�Ʈ Ŀ�ǵ带 ��������
�ϴ� ���Դϴ�.

������ ����� �������?

"Chong-Dae Park" <cdp...@jupiter.kaist.ac.kr> wrote in message
news:gvldk7$9ja$1...@news.kreonet.re.kr...

Chong-Dae Park

unread,
May 29, 2009, 5:31:57 AM5/29/09
to
demiahn <ahnda...@gmail.com> wrote:
> B | A
> �̰���, B�� ����� �Ŀ� �� ��� output�� A�� input���� ��޵˴ϴ�.
> ���� ���ϴ� ���� A�� B�� ���ÿ� ���� �ǰ� �ִ� ���¿���
> B�� A�� stdin���� ���𰡸� ����� �� �ִ� ����� �ִ��Ĵ� ���Դϴ�.

B�� ����DZ� �� A�� �Է��� ���ϴ�.
���� pipe ����̹Ƿ� console�� ���ʹ� flush ����� �ٸ��ϴ�.

console���� �Է��� ���� line ������ flush������, pipe������ block ������
flush�Ǵ� �����Դϴ�.

fflush ������� �ذ��� �� �ֽ��ϴ�.


--
������
--
The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded
as a bad move.
-- "The Restaurant at the End of the Universe", Douglas Adams

demiahn

unread,
May 29, 2009, 6:32:07 AM5/29/09
to
�����ϽŴ�� flush���� �����̾�׿�.
fflush�� �ذ��߽��ϴ�.
����Ͻʴϴ� ~~

"Chong-Dae Park" <cdp...@jupiter.kaist.ac.kr> wrote in message

news:gvoa2d$ki2$1...@news.kreonet.re.kr...

0 new messages