Bug 2689 – seek behaves incorrectly on MAC OSX

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
PowerPC
OS
Mac OS X
Creation time
2009-02-25T09:48:00Z
Last change time
2014-03-01T00:35:55Z
Assigned to
bugzilla
Creator
swadenator

Comments

Comment #0 by swadenator — 2009-02-25T09:48:51Z
The following code behaves differently on OSX than LINUX (DMD 1.040): import std.stdio; import std.stream; import std.file; int Lines(Stream f) { int ln = 0; foreach (char[] line; f) ln++; return ln; } void main(char[][] args) { auto f = new BufferedFile(args[1]); int l = Lines(f); f.seek(0, SeekPos.Set); int r = Lines(f); fwritef(stderr, "Lines before: %d, Lines after: %d\n", l, r); } Results for OSX: Lines before: 1633, Lines after: 0 Results for LINUX Lines before: 1633, Lines after: 1633 Seek not working properly perhaps? wade
Comment #1 by dfj1esp02 — 2009-02-26T09:18:03Z
lseek signature is wrong for osx. I wonder, whether POSIX.1 can be extracted according to standard? http://www.unix.org/version3/online.html
Comment #2 by sean — 2009-03-30T09:42:17Z
Fixed in DMD 2.027. DMD 1.x still needs to be fixed however, so this ticket can't be closed quite yet.
Comment #3 by bugzilla — 2009-04-01T13:47:21Z
Fixed DMD 1.042 and 2.027