Skip to content

Commit

Permalink
Merge pull request #76 from jasonwhite/not-hidden
Browse files Browse the repository at this point in the history
Don't set FILE_ATTRIBUTE_HIDDEN
  • Loading branch information
Stebalien committed Dec 28, 2018
2 parents 3d7ca36 + 221480b commit 95d08bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/file/imp/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use winapi::um::fileapi::{CreateFileW, SetFileAttributesW, CREATE_NEW};
use winapi::um::handleapi::INVALID_HANDLE_VALUE;
use winapi::um::winbase::{FILE_FLAG_DELETE_ON_CLOSE, MOVEFILE_REPLACE_EXISTING};
use winapi::um::winbase::{MoveFileExW, ReOpenFile};
use winapi::um::winnt::{FILE_ATTRIBUTE_HIDDEN, FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_TEMPORARY};
use winapi::um::winnt::{FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_TEMPORARY};
use winapi::um::winnt::{FILE_GENERIC_READ, FILE_GENERIC_WRITE, HANDLE};
use winapi::um::winnt::{FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE};

Expand All @@ -24,8 +24,7 @@ const SHARE_MODE: DWORD = FILE_SHARE_DELETE
| FILE_SHARE_READ
| FILE_SHARE_WRITE;
#[cfg_attr(irustfmt, rustfmt_skip)]
const FLAGS: DWORD = FILE_ATTRIBUTE_HIDDEN
| FILE_ATTRIBUTE_TEMPORARY;
const FLAGS: DWORD = FILE_ATTRIBUTE_TEMPORARY;

fn to_utf16(s: &Path) -> Vec<u16> {
s.as_os_str()
Expand Down
6 changes: 6 additions & 0 deletions tests/namedtempfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,9 @@ fn test_temppath_persist_noclobber() {
assert_eq!("abcde", buf);
std::fs::remove_file(&persist_path).unwrap();
}

#[test]
fn test_write_after_close() {
let path = NamedTempFile::new().unwrap().into_temp_path();
File::create(path).unwrap().write_all(b"test").unwrap();
}

0 comments on commit 95d08bd

Please sign in to comment.