The scope of a file descriptor
s8ngsu3_at_yahoo.com
Date: 12/28/04
- Next message: FX: "Re: Fortran compiler"
- Previous message: s8ngsu3_at_yahoo.com: "Using file system API"
- Next in thread: Arjen Markus: "Re: The scope of a file descriptor"
- Reply: Arjen Markus: "Re: The scope of a file descriptor"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Dec 2004 02:56:21 -0800
Is the scope of a file descriptor limited to the subroutine/function
where the file is opened, or can it be passed as an argument to another
subroutine? I.e., is it possible to open a file in the main part of a
program and write/read the file from some subroutine? I'm looking for a
Fortran equivalent of doing the following in C++:
void some_output (fstream& fout, int x)
{
fout << x;
}
int main ()
{
fstream afile ("somefile.txt", ios::out);
some_output (afile, 5);
afile.close();
}
- Next message: FX: "Re: Fortran compiler"
- Previous message: s8ngsu3_at_yahoo.com: "Using file system API"
- Next in thread: Arjen Markus: "Re: The scope of a file descriptor"
- Reply: Arjen Markus: "Re: The scope of a file descriptor"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|