2011-06-15 11:19:50 -07:00
|
|
|
|
|
|
|
|
2011-03-10 15:56:51 +01:00
|
|
|
native "rust" mod rustrt {
|
2011-06-15 11:19:50 -07:00
|
|
|
fn rust_list_files(str path) -> vec[str];
|
2011-07-12 15:14:57 -07:00
|
|
|
fn rust_list_files_ivec(str path) -> @str[];
|
2011-06-15 11:19:50 -07:00
|
|
|
fn rust_file_is_dir(str path) -> int;
|
2011-03-10 15:56:51 +01:00
|
|
|
}
|
|
|
|
|
2011-07-12 16:53:16 -07:00
|
|
|
fn list_dir(str path) -> str[] {
|
|
|
|
ret *rustrt::rust_list_files_ivec(path + "*");
|
|
|
|
}
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2011-06-17 15:52:37 -07:00
|
|
|
fn path_is_absolute(str p) -> bool {
|
|
|
|
ret str::char_at(p, 0u) == '/'
|
|
|
|
|| (str::char_at(p, 1u) == ':' && str::char_at(p, 2u) == '\\');
|
|
|
|
}
|
|
|
|
|
2011-03-20 19:43:12 -07:00
|
|
|
/* FIXME: win32 path handling actually accepts '/' or '\' and has subtly
|
|
|
|
* different semantics for each. Since we build on mingw, we are usually
|
|
|
|
* dealing with /-separated paths. But the whole interface to splitting and
|
|
|
|
* joining pathnames needs a bit more abstraction on win32. Possibly a vec or
|
|
|
|
* tag type.
|
|
|
|
*/
|
|
|
|
const char path_sep = '/';
|
2011-03-16 14:58:02 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
const char alt_path_sep = '\\';
|
2011-03-16 14:58:02 -07:00
|
|
|
// Local Variables:
|
|
|
|
// mode: rust;
|
|
|
|
// fill-column: 78;
|
|
|
|
// indent-tabs-mode: nil
|
|
|
|
// c-basic-offset: 4
|
|
|
|
// buffer-file-coding-system: utf-8-unix
|
2011-06-15 12:01:19 -07:00
|
|
|
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
|
2011-03-16 14:58:02 -07:00
|
|
|
// End:
|