LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is it possible to use file descriptor after main returns (https://www.linuxquestions.org/questions/linux-newbie-8/is-it-possible-to-use-file-descriptor-after-main-returns-720857/)

arun.raj 04-22-2009 03:27 AM

Is it possible to use file descriptor after main returns
 
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 ?

Thanks in advance .

Thanks,
A.R

acid_kewpie 04-22-2009 03:44 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


All times are GMT -5. The time now is 10:09 PM.