diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-11-22 15:14:34 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-22 15:14:34 -0800 |
| commit | d0a2f00611cc1622cfcd18dda66206277e8e2176 (patch) | |
| tree | a9658248c8ae2775b2fd51c99024921724597506 | |
| parent | 9dd4789d80b1313bb39daa8c8973e63a60b07b94 (diff) | |
| download | rust-d0a2f00611cc1622cfcd18dda66206277e8e2176.tar.gz rust-d0a2f00611cc1622cfcd18dda66206277e8e2176.zip | |
stdlib: win32 fixes for dir handling
| -rw-r--r-- | src/lib/fs.rs | 7 | ||||
| -rw-r--r-- | src/lib/win32_os.rs | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/fs.rs b/src/lib/fs.rs index 5d4db459b5b..655994b31d9 100644 --- a/src/lib/fs.rs +++ b/src/lib/fs.rs @@ -125,10 +125,11 @@ fn make_dir(p: path, mode: int) -> bool { ret mkdir(p, mode); #[cfg(target_os = "win32")] - fn mkdir(_p: path, _mode: int) -> bool { + fn mkdir(_p: path, _mode: int) -> bool unsafe { // FIXME: turn mode into something useful? ret str::as_buf(_p, {|buf| - os::kernel32::CreateDirectory(buf, ptr::null()) + os::kernel32::CreateDirectoryA( + buf, unsafe::reinterpret_cast(0)) }); } @@ -167,7 +168,7 @@ fn remove_dir(p: path) -> bool { #[cfg(target_os = "win32")] fn rmdir(_p: path) -> bool { - ret str::as_buf(_p, {|buf| os::kernel32::RemoveDirectory(buf)}); + ret str::as_buf(_p, {|buf| os::kernel32::RemoveDirectoryA(buf)}); } #[cfg(target_os = "linux")] diff --git a/src/lib/win32_os.rs b/src/lib/win32_os.rs index db9568c39a4..4b5635020d9 100644 --- a/src/lib/win32_os.rs +++ b/src/lib/win32_os.rs @@ -52,9 +52,9 @@ native mod kernel32 { fn GetModuleFileNameA(hModule: HMODULE, lpFilename: LPTSTR, nSize: DWORD) -> DWORD; - fn CreateDirectory(lpPathName: LPCTSTR, - lpSecurityAttributes: LPSECURITY_ATTRIBUTES) -> bool; - fn RemoveDirectory(lpPathName: LPCTSTR) -> bool; + fn CreateDirectoryA(lpPathName: LPCTSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES) -> bool; + fn RemoveDirectoryA(lpPathName: LPCTSTR) -> bool; } // FIXME turn into constants |
