Subj : Re: getting at FileName from *File To : borland.public.cpp.borlandcpp From : "Billly Pig" Date : Thu Jul 24 2003 09:27 am Thomas, Thanks for your reply - I was beginning to fear that would be the case. > Why would you want to know the filename? It is an unusual situation where I am coding a routine that is called by an external module over which I have little or no control. In particular, I cannot just change the function prototype to include the filename. In the past, this has not been an issue, because - as you pointed out - the filename is usually irrelevant. However, we now have a situation where the filename itself contains a field which we would like to store (it reflects the source application) . There are detours, but it would have been easier if we could get at the filename directly. In reality, this is a design issue that we must address. Thanks again for your reply. Pete K "Thomas Maeder [TeamB]" wrote in message news:m2brvlb4wf.fsf@madbox2.local... > "Billly Pig" writes: > > > Within a function that receives a > > *File parameter, is it possible to get the name of the associated file on > > Windows? > > No. One reason is that there are FILE * with no file name at all, e.g. stdin, > stdout and stderr, the result of a call to popen() etc. > > > > I don't have access to the calling routine, so I can't just do the obvious > > and pass the filenname as a parameter too. > > Why would you want to know the filename? .