|
Re: FILE Pointer: msg#00259gcc.help
On Tue, 27 May 2003, Eljay Love-Jensen wrote: > Hi Bharathi, > > >How to get the filename from the filepointer? > > You cannot. Actually, if it is Linux there is a way to find it (may be in *BSD too?). First get the fd entry using "fileno", and then use that in "getdents" to get the name. Look at 1. fileno (3) and 2. getdents (2) Muthu. > > >What are the other informations we can get from FILE structure? > > feof(fp) -- tells you if the file is at the end of file > ferror(fp) -- test whether read/write error has occurred > ftell(fp) -- tells you the offset into the file > fileno(fp) -- (non-ANSI) tells you the file descriptor of the fp > fgetpos(fp, &pos) -- for noting positions, used in conjunction with fsetpos > > HTH, > --Eljay > |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Trouble building an Intel to SPARC cross-compiler: 00259, Daniel Salomon |
|---|---|
| Next by Date: | Specs vs static linkage?: 00259, Robin Hu |
| Previous by Thread: | Re: FILE Pointeri: 00259, Eljay Love-Jensen |
| Next by Thread: | Re: FILE Pointer: 00259, Michael Meissner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |