Re: Help ! how to get a file size larger than 2G?



In article <fdmtlu$kd$1@xxxxxxxxxxxxxx>, zou <zouwan@xxxxxxxxx> wrote:

but stat::st_size is type of off_t(typedef long),
so how about a file larger than 2G?

I suppose by "stat::st_size" you mean the st_size field of the stat
structure. Note that stat() isn't a standard C function, but a unix
one which has made its way into some other systems.

Some systems have a symbol you can #define to make off_t be a 64-bit
type on a system where it is usually 32 bits. It appears to be
__USE_FILE_OFFSET64 on a Linux system here, but I have no experience
of using it so I recommend you ask in a group more specific to your
system.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
.



Relevant Pages

  • Re: How to get the create date of a file ...
    ... > attention to the lstat and stat sections. ... Unix didn't used to track the create date of a file. ... The standard of success is the alternative. ...
    (comp.lang.tcl)
  • Re: Linux Sys Calls - int 80h
    ... >> the C calling conventions ... > implementation detail, which will vary from system to system, as ... wrapping this in a convenient form to the original UNIX C calls... ... parties) as an "agreed" _standard_ between parties to follow... ...
    (alt.lang.asm)
  • Re: Rewriting and predictions
    ... not led to any improvements worth porting. ... then you claim others would rewrite it into standard Forth, ... I thought they could run some sort of Unix ... But I expect Win32Forth will become WForth (the name WinForth ...
    (comp.lang.forth)
  • Re: Alpha remembrance day
    ... project, Alpha the soup to nuts "Industry Standard" 64 bit processor, ... switching to TCPIP when the later replaced OSI as the "internetworking" ... VMS didn't. ... UNIX Server/Workstation. ...
    (comp.os.vms)
  • Re: mkdir() wont do it for me
    ... C standard apart from the odd bug. ... just accepting mkdir() as a fact of a "C" programmer's ... but only because I fished it out of the trash of "Unix house" I ... there are networking groups. ...
    (comp.lang.c)