From 429b5f88f91e5f23f1ad04f6f9938fd1fa6c39a1 Mon Sep 17 00:00:00 2001 From: Jeff Olson Date: Wed, 21 Aug 2013 21:29:23 -0700 Subject: [PATCH] std: rename tmp file paths to go into ./tmp folder in builddir --- src/libstd/rt/io/file.rs | 14 +++++++------- src/libstd/rt/uv/file.rs | 4 ++-- src/libstd/rt/uv/uvio.rs | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/libstd/rt/io/file.rs b/src/libstd/rt/io/file.rs index b7a923d94c7..c4ec19b6d27 100644 --- a/src/libstd/rt/io/file.rs +++ b/src/libstd/rt/io/file.rs @@ -192,7 +192,7 @@ impl Seek for FileStream { fn file_test_smoke_test_impl() { do run_in_newsched_task { let message = "it's alright. have a good time"; - let filename = &Path("./rt_io_file_test.txt"); + let filename = &Path("./tmp/file_rt_io_file_test.txt"); { let mut write_stream = FileStream::open(filename, Create, ReadWrite).unwrap(); write_stream.write(message.as_bytes()); @@ -218,7 +218,7 @@ fn file_test_io_smoke_test() { fn file_test_invalid_path_opened_without_create_should_raise_condition_impl() { do run_in_newsched_task { - let filename = &Path("./file_that_does_not_exist.txt"); + let filename = &Path("./tmp/file_that_does_not_exist.txt"); let mut called = false; do io_error::cond.trap(|_| { called = true; @@ -236,7 +236,7 @@ fn file_test_io_invalid_path_opened_without_create_should_raise_condition() { fn file_test_unlinking_invalid_path_should_raise_condition_impl() { do run_in_newsched_task { - let filename = &Path("./another_file_that_does_not_exist.txt"); + let filename = &Path("./tmp/file_another_file_that_does_not_exist.txt"); let mut called = false; do io_error::cond.trap(|_| { called = true; @@ -256,7 +256,7 @@ fn file_test_io_non_positional_read_impl() { use str; let message = "ten-four"; let mut read_mem = [0, .. 8]; - let filename = &Path("./rt_io_file_test_positional.txt"); + let filename = &Path("./tmp/file_rt_io_file_test_positional.txt"); { let mut rw_stream = FileStream::open(filename, Create, ReadWrite).unwrap(); rw_stream.write(message.as_bytes()); @@ -291,7 +291,7 @@ fn file_test_io_seeking_impl() { let set_cursor = 4 as u64; let mut tell_pos_pre_read; let mut tell_pos_post_read; - let filename = &Path("./rt_io_file_test_seeking.txt"); + let filename = &Path("./tmp/file_rt_io_file_test_seeking.txt"); { let mut rw_stream = FileStream::open(filename, Create, ReadWrite).unwrap(); rw_stream.write(message.as_bytes()); @@ -324,7 +324,7 @@ fn file_test_io_seek_and_write_impl() { let final_msg = "foo-the-bar!!"; let seek_idx = 3; let mut read_mem = [0, .. 13]; - let filename = &Path("./rt_io_file_test_seek_and_write.txt"); + let filename = &Path("./tmp/file_rt_io_file_test_seek_and_write.txt"); { let mut rw_stream = FileStream::open(filename, Create, ReadWrite).unwrap(); rw_stream.write(initial_msg.as_bytes()); @@ -354,7 +354,7 @@ fn file_test_io_seek_shakedown_impl() { let chunk_two = "asdf"; let chunk_three = "zxcv"; let mut read_mem = [0, .. 4]; - let filename = &Path("./rt_io_file_test_seek_shakedown.txt"); + let filename = &Path("./tmp/file_rt_io_file_test_seek_shakedown.txt"); { let mut rw_stream = FileStream::open(filename, Create, ReadWrite).unwrap(); rw_stream.write(initial_msg.as_bytes()); diff --git a/src/libstd/rt/uv/file.rs b/src/libstd/rt/uv/file.rs index f88731ca635..6abc21219e9 100644 --- a/src/libstd/rt/uv/file.rs +++ b/src/libstd/rt/uv/file.rs @@ -281,7 +281,7 @@ mod test { // these aren't defined in std::libc :( //map_mode(S_IRGRP) | //map_mode(S_IROTH); - let path_str = "./file_full_simple.txt"; + let path_str = "./tmp/file_full_simple.txt"; let write_val = "hello".as_bytes().to_owned(); let write_buf = slice_to_uv_buf(write_val); let write_buf_ptr: *Buf = &write_buf; @@ -352,7 +352,7 @@ mod test { S_IRUSR; //S_IRGRP | //S_IROTH; - let path_str = "./file_full_simple_sync.txt"; + let path_str = "./tmp/file_full_simple_sync.txt"; let write_val = "hello".as_bytes().to_owned(); let write_buf = slice_to_uv_buf(write_val); // open/create diff --git a/src/libstd/rt/uv/uvio.rs b/src/libstd/rt/uv/uvio.rs index 8d76c5e8727..fa5b4943297 100644 --- a/src/libstd/rt/uv/uvio.rs +++ b/src/libstd/rt/uv/uvio.rs @@ -1711,7 +1711,7 @@ fn file_test_uvio_full_simple_impl() { let ro_flags = O_RDONLY; let write_val = "hello uvio!"; let mode = S_IWUSR | S_IRUSR; - let path = "./file_test_uvio_full.txt"; + let path = "./tmp/file_test_uvio_full.txt"; { let mut fd = (*io).fs_open(&Path(path), create_flags as int, mode as int).unwrap(); let write_buf = write_val.as_bytes();