2670 – std.file.read() should read files of 0 length

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2670 - std.file.read() should read files of 0 length
Summary: std.file.read() should read files of 0 length
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2009年02月16日 03:50 UTC by Walter Bright
Modified: 2015年06月09日 05:15 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Walter Bright 2009年02月16日 03:50:31 UTC
Some files, such as:
char[] thing = cast(char[])std.file.read("/proc/sys/kernel/osrelease");
stat as having 0 size, and so thing[] comes back with 0 length. But if the file is read anyway with C's read(), there is data in it.
Comment 1 Walter Bright 2009年03月11日 14:53:33 UTC
Fixed dmd 1.041 and 2.026


AltStyle によって変換されたページ (->オリジナル) /