Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Retrieving fstream filename?

Reply
Thread Tools

Retrieving fstream filename?

 
 
Randy Yates
Guest
Posts: n/a
 
      10-15-2004
Is there any way to get the filename with which a stream was opened? I don't
see anything obvious in the stream API.
--
% Randy Yates % "Ticket to the moon, flight leaves here today
%% Fuquay-Varina, NC % from Satellite 2"
%%% 919-577-9882 % 'Ticket To The Moon'
%%%% <(E-Mail Removed)> % *Time*, Electric Light Orchestra
http://home.earthlink.net/~yatescr
 
Reply With Quote
 
 
 
 
John Harrison
Guest
Posts: n/a
 
      10-15-2004

"Randy Yates" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there any way to get the filename with which a stream was opened? I
> don't
> see anything obvious in the stream API.


No there isn't.

john


 
Reply With Quote
 
 
 
 
Tom Widmer
Guest
Posts: n/a
 
      10-15-2004
On Fri, 15 Oct 2004 05:33:16 GMT, Randy Yates <(E-Mail Removed)> wrote:

>Is there any way to get the filename with which a stream was opened? I don't
>see anything obvious in the stream API.


No, you'll have to derive a class from fstream (slightly dangerous
since the "open" member isn't virtual), or create a class that holds
the filename and an fstream.

Tom
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is different between <fstream.h> and <fstream>MS VC++ Armando C++ 6 01-29-2004 09:01 AM
Weird thing with fstream gukn9700 C++ 0 07-17-2003 09:28 AM
fstream problem las C++ 1 07-16-2003 12:09 PM
vector of fstream Marc Schellens C++ 2 07-16-2003 06:02 AM
fstream.open( name, mode) fails Marc Schellens C++ 0 07-15-2003 01:35 PM



Advertisments