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

File size > 4 GB

P: n/a
Hi,

How to get a file size > 4GB on Windows 2000 (NTFS)?

for example:

struct ffblk blk;
if(findfirst(filename,&blk,0)!=0) return(-1);
return(blk.ff_fsize);

.... won't work as it return a long.

but an unsigned long with 32 bits can only store 4,294,967,295.

So what method can I use to get the file size ?

Mickael.
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
# So what method can I use to get the file size ?

You can try fpos_t with fgetpos and fsetpos. That should get you the maximum
possible file offset for your system. The system include files will likely
define fpos_t, and you can exploit it, for example if it is a long long,
but such code will be system dependent.

--
Derk Gwen http://derkgwen.250free.com/html/index.html
She broke your heart and inadvertendently drove men to deviant lifestyles.
Nov 13 '05 #2

P: n/a
On 11 Nov 2003 00:22:03 -0800, in comp.lang.c , fa*****@hotmail.com
(Mickael Faivre-Macon) wrote:
Hi,

How to get a file size > 4GB on Windows 2000 (NTFS)?
Via windows specific function calls, which are offtopic here.
if(findfirst(filename,&blk,0)!=0) return(-1);
... won't work as it return a long.


Indeed. These old DOS functions are not designed for NTFS.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.