Retrieving fstream filename?

R

Randy Yates

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'
%%%% <[email protected]> % *Time*, Electric Light Orchestra
http://home.earthlink.net/~yatescr
 
J

John Harrison

Randy Yates said:
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
 
T

Tom Widmer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top