EmbLogic's Blog

Implementation of execl() and fork() for writing into textfile from the child process

RCS file: replacing.c,v
Working file: replacing.c
head: 1.3
branch:
locks: strict
	root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
In this program we have used fork()
----------------------------
revision 1.3	locked by: root;
date: 2015/02/26 10:36:34;  author: root;  state: Exp;  lines: +2 -2
nw we have passed the fd by using execl()
fd was of integer type bt execl() accepts character string so thats why we have converted int to char type by using sprintf command
----------------------------
revision 1.2
date: 2015/02/26 09:30:31;  author: root;  state: Exp;  lines: +14 -1
opening the a textfile
invoking execl inside the child process
----------------------------
revision 1.1
date: 2015/02/26 09:05:11;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
	root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
included the various header files that have beent are used in the program
----------------------------
revision 1.2	locked by: root;
date: 2015/02/26 09:33:05;  author: root;  state: Exp;  lines: +1 -0
just included a header file i.e fcntl.h for opening the file
----------------------------
revision 1.1
date: 2015/02/26 09:07:47;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: new.c,v
Working file: new.c
head: 1.2
branch:
locks: strict
	root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
just given a printf statement for printing the statement.
----------------------------
revision 1.2	locked by: root;
date: 2015/02/26 10:39:29;  author: root;  state: Exp;  lines: +8 -2
firstly we have converted back to int using atoi 
then we are writing the string into the textfile
----------------------------
revision 1.1
date: 2015/02/26 09:35:46;  author: root;  state: Exp;
Initial revision
=============================================================================

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>