stdlib: win32 fixes for dir handling
This commit is contained in:
parent
9dd4789d80
commit
d0a2f00611
|
@ -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")]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue