mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 16:15:03 +00:00
move fs routines to c-stack-stdlib
This commit is contained in:
parent
4880065429
commit
b13e7e0f3d
@ -2,7 +2,7 @@
|
||||
import os::getcwd;
|
||||
import os_fs;
|
||||
|
||||
native "rust" mod rustrt {
|
||||
native "c-stack-cdecl" mod rustrt {
|
||||
fn rust_file_is_dir(path: str::sbuf) -> int;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
native "rust" mod rustrt {
|
||||
native "c-stack-cdecl" mod rustrt {
|
||||
fn rust_list_files(&&path: str) -> [str];
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
native "rust" mod rustrt {
|
||||
native "c-stack-cdecl" mod rustrt {
|
||||
fn rust_list_files(&&path: str) -> [str];
|
||||
fn rust_file_is_dir(&&path: str) -> int;
|
||||
}
|
||||
|
@ -325,12 +325,12 @@ debug_ptrcast(type_desc *from_ty,
|
||||
}
|
||||
|
||||
extern "C" CDECL rust_vec*
|
||||
rust_list_files(rust_vec **path) {
|
||||
rust_list_files(rust_str *path) {
|
||||
rust_task *task = rust_scheduler::get_task();
|
||||
array_list<rust_str*> strings;
|
||||
#if defined(__WIN32__)
|
||||
WIN32_FIND_DATA FindFileData;
|
||||
HANDLE hFind = FindFirstFile((char*)(*path)->data, &FindFileData);
|
||||
HANDLE hFind = FindFirstFile((char*)path->data, &FindFileData);
|
||||
if (hFind != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
rust_str *str = make_str(task->kernel, FindFileData.cFileName,
|
||||
@ -341,7 +341,7 @@ rust_list_files(rust_vec **path) {
|
||||
FindClose(hFind);
|
||||
}
|
||||
#else
|
||||
DIR *dirp = opendir((char*)(*path)->data);
|
||||
DIR *dirp = opendir((char*)path->data);
|
||||
if (dirp) {
|
||||
struct dirent *dp;
|
||||
while ((dp = readdir(dirp))) {
|
||||
|
Loading…
Reference in New Issue
Block a user