delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/04/11/09:46:12

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Glaux" <glaux AT centrum DOT cz>
Newsgroups: comp.os.msdos.djgpp
Subject: statfs reports diff info under Win9x vs WinXP (using djdev 2.04)
Date: 11 Apr 2007 06:37:19 -0700
Organization: http://groups.google.com
Lines: 17
Message-ID: <1176298639.513643.155530@n59g2000hsh.googlegroups.com>
NNTP-Posting-Host: 89.176.103.125
Mime-Version: 1.0
X-Trace: posting.google.com 1176298640 16653 127.0.0.1 (11 Apr 2007 13:37:20 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Wed, 11 Apr 2007 13:37:20 +0000 (UTC)
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.13) Gecko/20060414,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: n59g2000hsh.googlegroups.com; posting-host=89.176.103.125;
posting-account=79KgoA0AAADKuOLK3k0Y3qVqk-KGfm77
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,
only thing I needed is to get free disk space, so I write a small
function:

QWord disk_avail(char *path)
{
  struct statfs fs;
  statfs(path,&fs);                    // nacti info o VFS do
struktury
  return((QWord)fs.f_bsize*(QWord)fs.f_bfree);
}

Under Win9x it works fine but under XP it reports much less free space
than really is but only if the free space is beyond 2GB. I think
there's somewhere some data type limitadion. Is there better way to do
this to make it working for all DOS/9x/NT ?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019