I would like to know is there any method/mechanism/logic to share
fd opened by application_1 which can be used in application_2.
On Wed, Apr 22, 2009 at 5:56 PM, pradeep singh <pradeep.rautela@xxxxxxxxx> wrote:
Right. So better try to fork a new process or create a new thread,On Wed, Apr 22, 2009 at 1:33 PM, Arun raj <arun.raj.linux@xxxxxxxxx> wrote:
> Hello All,
>
> I want to use the file descriptor opened by application_1 in another
> application_2, i.e
>
> ./application_1 :
> main()
> {
> fd_1 = open( file );
> return fd_1;
> }
>
> ./application_2 fd_1
> main()
> {
> ret = read( fd_1 );
> return fd;
> }
>
> My concern is once application_1 main returns all open fds will be closed
> right ?
that way you may share the same fd between them.
Once you have the fd, do whatever you want to do with it.
Si this what you want ?
HTH
>--
> Thanks in advance .
>
> Thanks,
> A.R
>
>
Pradeep