delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2016/12/20/06:15:12

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Received: by 10.99.100.133 with SMTP id y127mr11178463pgb.144.1482231884340;
Tue, 20 Dec 2016 03:04:44 -0800 (PST)
X-Received: by 10.157.52.119 with SMTP id v110mr227978otb.3.1482231884243;
Tue, 20 Dec 2016 03:04:44 -0800 (PST)
Newsgroups: comp.os.msdos.djgpp
Date: Tue, 20 Dec 2016 03:04:44 -0800 (PST)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.113.69.76; posting-account=Q0wMHAoAAADjYrghh94FTf6YnbpTqZgp
NNTP-Posting-Host: 94.113.69.76
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <97c92faf-c9df-4ccf-85f9-d10ab659a8c4@googlegroups.com>
Subject: DJGPP problem with getting file size via fstat or not implemented yet?
From: "RayeR (glaux AT centrum DOT cz) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
Injection-Date: Tue, 20 Dec 2016 11:04:44 +0000
Bytes: 1678
Lines: 14
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id uBKBF2SY015965
Reply-To: djgpp AT delorie DOT com

Hi, I compiled the Wavpack lossless codec tool and found a problem in function DoGetFileSize() that on unix systems use this code:

struct stat statbuf;

    if (!hFile || fstat (fileno (hFile), &statbuf) || !(statbuf.st_mode & S_IFREG))
        return 0;

    return (int64_t) statbuf.st_size;

The problem is that it returns zero. So I used lfilelength(fileno(hFile) function that works. Does it mean that there's a bug in fstat or it is not implemented at all (just a dummy)? Does lfilelength() supports >2GB files on enabled filesystems (like NTFS under NTVDM)?

- Raw text -


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