By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,233 Members | 2,041 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,233 IT Pros & Developers. It's quick & easy.

ftell()

P: n/a
GiM
What will ftell() return,
if I'm at the end of file that has size > 4G ?

cya GiM
--
"Nie rozwi±zali jednak fundamentalnych problemów natury
i celu Wszech¶wiata. Na przykład: jakiej płci jest A'Tuin"
- T.P. - Kolor Magii

Nov 14 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"GiM" <ab***@tpnet.pl> wrote in message
news:sl******************@158.75.91.132...
What will ftell() return,
if I'm at the end of file that has size > 4G ?


there's no telling if you're using a platform where long is 32 bits. (as you
probably are)
Better to use fgetpos instead.
Nov 14 '05 #2

P: n/a
"Servé Lau" <i@bleat.nospam.com> wrote:
: "GiM" <ab***@tpnet.pl> wrote in message
: news:sl******************@158.75.91.132...
:> What will ftell() return,
:> if I'm at the end of file that has size > 4G ?

: there's no telling if you're using a platform where long is 32 bits. (as you
: probably are)
: Better to use fgetpos instead.

Correct, the reason being that -- unlike ftell(), which only returns the
current file position or garbage -- fgetpos() returns -1 on failure, and
also sets `errno' to the cause of error (EINVAL).
Nov 14 '05 #3

P: n/a
in comp.lang.c i read:
unlike ftell(), which only returns the
current file position or garbage -- fgetpos() returns -1 on failure, and
also sets `errno' to the cause of error (EINVAL).


the return values are zero on success and non-zero on failure, and in
neither case is it required that errno be set. on posix/sus systems errno
is required to be set, but the return value on failure is not required to
be -1, only non-zero.

--
a signature
Nov 14 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.