From -5495118825043052700 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,8229fd0d89d55aa7,start X-Google-Attributes: gidf78e5,public From: "Jim Cobban" Subject: Access to fstat for an fstream Date: 1998/04/06 Message-ID: <6gb6t9$4ni@bcarh8ab.bnr.ca>#1/1 X-Deja-AN: 341438270 Approved: Fergus Henderson X-Original-Date: 6 Apr 1998 18:28:57 GMT X-Authentication-Warning: bcarh8ab: news set sender to jcobban@nortel.ca using -f Organization: Nortel X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANSkmT+EDnX0m9pzZAQFD3wF/cfV3nXyDjvYyNqgn8x9r77J9i4qKvS1x QQPlvFJzFo1dmEb2/moEv+vuDk3C+cBB =1sch Newsgroups: comp.std.c++ In the C++ standard, as opposed to some early implementations, there is no way to extract the UNIX file descriptor from an fstream. This is a good thing because exposing this value would permit the programmer to do potentially dangerous things like closing the file without letting the fstream know. However there are some capabilities which are provided by the file descriptor interface in POSIX which are not exposed through the fstream interface. In particular I am thinking of fstat. There may be others that I can't think of, or otherwise the early implementations would not have exposed the file descriptor. I suggest that there should be a method fstream_base::stat(struct stat *). -- Jim Cobban | jcobban@nortel.ca | Phone: (613) 763-8013 Nortel (MCS) | | FAX: (613) 763-5199 | "I am not a number. I am a human being!" | P. McGoohan, "The Prisoner" --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]