提交 06a60054 编写于 作者: B Brian Anderson

Use correct win file open constants, per MinGW

上级 a0a2cee8
......@@ -32,12 +32,12 @@ mod libc_constants {
fn O_RDONLY() -> int { ret 0; }
fn O_WRONLY() -> int { ret 1; }
fn O_RDWR() -> int { ret 2; }
fn O_APPEND() -> int { ret 1024; }
fn O_CREAT() -> int { ret 64; }
fn O_EXCL() -> int { ret 128; }
fn O_TRUNC() -> int { ret 512; }
fn O_TEXT() -> int { ret 16384; }
fn O_BINARY() -> int { ret 32768; }
fn O_APPEND() -> int { ret 0x0008; }
fn O_CREAT() -> int { ret 0x0100; }
fn O_EXCL() -> int { ret 0x0400; }
fn O_TRUNC() -> int { ret 0x0200; }
fn O_TEXT() -> int { ret 0x4000; }
fn O_BINARY() -> int { ret 0x8000; }
fn S_IRUSR() -> uint {
ret 256u; // really _S_IREAD in win32
......
// xfail-stage0
// xfail-stage1
// xfail-stage2
// -*- rust -*-
use std;
import std::io;
import std::str;
fn test_simple(str tmpfilebase) {
let str tmpfile = tmpfilebase + ".tmp";
fn test_simple() {
let str tmpfile = "test/run-pass/lib-io-test-simple.tmp";
log tmpfile;
let str frood = "A hoopy frood who really knows where his towel is.";
log frood;
{
let io::writer out = io::file_writer(tmpfile, [io::create]);
let io::writer out = io::file_writer(tmpfile, [io::create,
io::truncate]);
out.write_str(frood);
}
let io::reader inp = io::file_reader(tmpfile);
......@@ -23,4 +20,6 @@ fn test_simple(str tmpfilebase) {
assert (str::eq(frood, frood2));
}
fn main(vec[str] argv) { test_simple(argv.(0)); }
\ No newline at end of file
fn main() {
test_simple();
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册