what's the meaning of 64 in fopen64

M

Medvedev

what's the meaning of the number 64 in the function fopen64?!!!
i know fopen64 used to open big files but what 64 refer to
and how much the usual fopen can open
-
pls explain
 
V

vippstar

what's the meaning of the number 64 in the function fopen64?!!!
i know fopen64 used to open big files but what 64 refer to
and how much the usual fopen can open
fopen64() is not a standard function.
Presumably it means that this function can open files as large as 2^64
bytes.
That particular implementation/standard probably also offers ftell64()
or similar.
With a google I find that fopen64 is part of the Large File Spec,
something about SuS.
It would be better for you to ask about fopen64() in
comp.unix.programmer, because it's topical there.

The C standard deals with this in another way, with fgetpos() and
fsetpos().
fopen() works fine with files of any size - it's ftell for example
that doesn't.
See question 12.25 of the C-FAQ.
<http://c-faq.com/>
 
V

viza

Hi


There is no one answer to that, but see below about 32 bit off_t.
Presumably it means that this function can open files as large as
2^64 bytes. That particular implementation/standard probably also
offers ftell64() or similar.

I guess it is analogous to fopen but implemented in terms of off64_t
wherever off_t might have been used (if at all). It would be able to
handle files of up to ~2^63 bytes since off_t is signed (to allow one to
seek backwards).
With a google I find that fopen64 is part of the Large File Spec,
something about SuS.

It was (or is) an interim measure to allow *nix programs to handle files
larger than 2GB while still being ABI compatible with libc's where off_t
is 32 bits. Almost all new (desktop & server, at least) architectures
have off_t as 64 bits, so new programs may decide to ignore the
extensions, at a cost of compatibility with large files on older or
unusual systems. In such cases smaller files will still work, but the
process gets delivered a signal if a file grows to big.

RTFM:
man lseek64

HTH
viza
 
V

vippstar

<snip off-topic>
viza, since you seem to be fond of helping people asking UNIX
questions here on comp.lang.c, the next time you are going to answer
one, set the follow-ups to comp.unix.programmer.
 
V

viza

Hi

viza, since you seem to be fond of helping people asking UNIX questions
here on comp.lang.c, the next time you are going to answer one, set the
follow-ups to comp.unix.programmer.

If you had followed your own advice then my reply to your post would have
gone there! :-D

viza
 
V

vippstar

Hi



If you had followed your own advice then my reply to your post would have
gone there! :-D
Wrong, my reply was about the topicality of this newsgroup.
Please don't post off-topic UNIX advice here.
 
A

Antoninus Twink

If you had followed your own advice then my reply to your post would have
gone there! :-D

Hypocrisy is the stock-in-trade of most of the topicality nazis.

I'd ignore vippstar - he's a troll who only seeks to disrupt the group
by attacking people who contribute useful information.
 
B

Barry Schwarz

what's the meaning of the number 64 in the function fopen64?!!!
i know fopen64 used to open big files but what 64 refer to
and how much the usual fopen can open

The first 63 versions of the function did not work properly or did not
sell well.


Remove del for email
 
C

CBFalconer

Barry said:
The first 63 versions of the function did not work properly or
did not sell well.

I assume you are trying to contest Antonius Twink for his position
of glory? :)
 

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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top