|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I noticed there is no method to get size of file using io classes from
file_pov.cpp. I wonder it is not implemented becouse there was no need for it
yet or becouse it can't work or becouse there are better ways to do it ?
Waiting for answer I have adjusted it for my purposes this way:
file_pov.h
class pov_io_base
{
public:
......
long fsize(void);
......
}
file_pov.cpp
......
#include <io.h>
......
long pov_io_base::fsize (void)
{
return (filelength(fileno(f))) ;
}
Is it a correct way according to intentions of io classes ?
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <iktp2vgbengh0evamff3k6fvugrbt3l3kr@4ax.com> , ABX
<abx### [at] abxartpl> wrote:
> Is it a correct way according to intentions of io classes ?
No, the code is not portable.
This has not been implemented because it was not needed. The correct way to
implement it in a portable manner is to seek with zero bytes offset relative
to the end, then determine the file position and then to seek back to
wherever one ones before.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
ABX wrote:
>
> I noticed there is no method to get size of file using io classes from
> file_pov.cpp. I wonder it is not implemented becouse there was no need for it
> yet or becouse it can't work or becouse there are better ways to do it ?
> Waiting for answer I have adjusted it for my purposes this way:
>
> [...]
How about portability?
http://poli.cs.vsb.cz/c/help/io.htm#LBL42
Christoph
--
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 31 Dec. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Tue, 21 Jan 2003 09:34:00 +0100, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> This has not been implemented because it was not needed. The correct way to
> implement it in a portable manner is to seek with zero bytes offset relative
> to the end, then determine the file position and then to seek back to
> wherever one ones before.
Thanks for hint.
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Tue, 21 Jan 2003 09:37:02 +0100, Christoph Hormann <chr### [at] gmxde>
wrote:
> How about portability?
>
> http://poli.cs.vsb.cz/c/help/io.htm#LBL42
Thanks, for unknown reasons I missed portability subsection in my own
resources.
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |