Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: localhost.localdomain: ronald owned process doing -bs Date: Thu, 10 Jul 2003 15:12:47 +0200 (CEST) From: Ronald Landheer-Cieslak X-X-Sender: ronald AT localhost DOT localdomain To: cygwin AT cygwin DOT com Subject: Re: cygwin-1.5.0-1: Problem stat-ing big file In-Reply-To: <20030710115455.GW12368@cygbert.vinschen.de> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1056782061-1057842767=:1001" --8323328-1056782061-1057842767=:1001 Content-Type: TEXT/PLAIN; charset=US-ASCII I tried pretty much the same thing with the attached files (test.c generates a very big file, stat.c checks its size, cygcheck.out is available at http://blytkerchan.chez.tiscali.fr/cygcheck.out (md5 sum: 56aa8e6d575d27bf8a2b740a25e13dd0) because it's rather large and not very interesting. Worked like a charm ! Thanx rlc On Thu, 10 Jul 2003, Corinna Vinschen wrote: > On Thu, Jul 10, 2003 at 01:35:37PM +0200, Corinna Vinschen wrote: > > On Thu, Jul 10, 2003 at 01:26:34PM +0200, Markus Sch?nhaber wrote: > > > While trying if the new support for files larger than 2GB works, I > > > created a file with a size of 4.53 GB (4,869,120,000 Bytes) using a > > > simple write in python. No problems here. But when stat-ing the file > > > with python's os.stat or by calling stat from C as done in the little > > > program below, the size of the file gets reported as 574,152,704 Bytes. > > > > The changes to 64 bit file access are not propagated automatically to > > existing applications. E.g. the current `ls' from the fileutils > > package is compiled with the old (small) stat structure which only > > has 32 bit off_t for the file size. If you want to actually use the > > new struct stat and off_t with 64 bit, you have to recompile the > > application. > > > > Sorry, but there's no way around that. > > ...and two more hints, just to clarify that a bit: > > - You must compile using the header files and libcygwin.a which has been > released together with the DLL to get the correct results. Mixing > old Cygwin headers with the new import lib or vice versa are sure > candidates for segmentation fauls. > > - Since off_t is now 64 bit and the st_size member of struct stat is a > off_t, your printf isn't correct: > > printf("Size of file <%s>: %lld", argv[1], s.st_size); > ^^^^ > > %lld is necessary. %ld matches 32 bit types on Cygwin. > > > Corinna > > --8323328-1056782061-1057842767=:1001 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="test.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: test.c Content-Disposition: attachment; filename="test.c" I2luY2x1ZGUgPGFzc2VydC5oPg0KI2luY2x1ZGUgPHN5cy90eXBlcy5oPg0K I2luY2x1ZGUgPHN5cy9zdGF0Lmg+DQojaW5jbHVkZSA8c3RkaW8uaD4NCiNp bmNsdWRlIDxzdGRsaWIuaD4NCg0KI2RlZmluZSBOX0dCIDUNCg0KaW50IG1h aW4oIHZvaWQgKQ0Kew0KICAgaW50IGk7DQogICBjaGFyIGJ1ZmZlclsxMDI0 XTsNCiAgIHN0cnVjdCBzdGF0IHN0YXRfaW5mbzsNCg0KICAgRklMRSAqb3V0 ID0gZm9wZW4oICJvdXQiLCAid2ViIiApOw0KDQogICBmb3IgKCBpID0gMDsg aSA8IE5fR0IgKiAxMDI0ICogMTAyNDsgaSsrICkNCiAgIHsNCiAgICAgIGlm ICggZndyaXRlKCBidWZmZXIsIDEwMjQsIDEsIG91dCApICE9IDEgKQ0KICAg ICAgew0KCSBhYm9ydCggICk7DQogICAgICB9DQogICB9DQoNCiAgIGZjbG9z ZSggb3V0ICk7DQoNCiAgIHN0YXQoICJvdXQiLCAmc3RhdF9pbmZvICk7DQog ICBhc3NlcnQoICggc3RhdF9pbmZvLnN0X3NpemUgLyAoIDEwMjQgKiAxMDI0 ICogMTAyNCApICkgPT0gTl9HQiApOw0KDQogICByZXR1cm4gKCAwICk7DQp9 DQo= --8323328-1056782061-1057842767=:1001 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="stat.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: stat.c Content-Disposition: attachment; filename="stat.c" I2luY2x1ZGUgPHN5cy90eXBlcy5oPg0KI2luY2x1ZGUgPHN5cy9zdGF0Lmg+ DQojaW5jbHVkZSA8c3RkaW8uaD4NCg0KaW50IG1haW4oIGludCBhcmdjLCBj aGFyICoqYXJndiApDQp7DQogICBzdHJ1Y3Qgc3RhdCBzdGF0X2luZm87DQoN CiAgIGFyZ3YrKzsNCiAgIHdoaWxlICggYXJndlswXSAhPSBOVUxMICkNCiAg IHsNCiAgICAgIGlmICggc3RhdCggYXJndlswXSwgJnN0YXRfaW5mbyApID09 IDAgKQ0KCSBwcmludGYoICIlczogJWxsZFxuIiwgYXJndlswXSwgc3RhdF9p bmZvLnN0X3NpemUgKTsNCiAgICAgIGFyZ3YrKzsNCiAgIH0NCg0KICAgcmV0 dXJuICggMCApOw0KfQ0K --8323328-1056782061-1057842767=:1001 Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ --8323328-1056782061-1057842767=:1001--