aboutsummaryrefslogtreecommitdiff
path: root/src/lib/win32_FS.rs
diff options
context:
space:
mode:
authorMarijn Haverbeke <[email protected]>2011-05-06 22:13:13 +0200
committerMarijn Haverbeke <[email protected]>2011-05-06 22:51:19 +0200
commita3ec0b1f643d00b9418e4884bd7caa07bf052201 (patch)
tree82000510ac9c9cf3f0c7cf4ae5f3c6b123b559cb /src/lib/win32_FS.rs
parentRegister new snapshots. (diff)
downloadrust-a3ec0b1f643d00b9418e4884bd7caa07bf052201.tar.xz
rust-a3ec0b1f643d00b9418e4884bd7caa07bf052201.zip
Rename std modules to be camelcased
(Have fun mergining your stuff with this.)
Diffstat (limited to 'src/lib/win32_FS.rs')
-rw-r--r--src/lib/win32_FS.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/win32_FS.rs b/src/lib/win32_FS.rs
new file mode 100644
index 00000000..94599e3c
--- /dev/null
+++ b/src/lib/win32_FS.rs
@@ -0,0 +1,26 @@
+native "rust" mod rustrt {
+ fn rust_list_files(str path) -> vec[str];
+ fn rust_file_is_dir(str path) -> int;
+}
+
+fn list_dir(str path) -> vec[str] {
+ ret rustrt.rust_list_files(path+"*");
+}
+
+/* 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 = '/';
+const char alt_path_sep = '\\';
+
+// Local Variables:
+// mode: rust;
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// compile-command: "make -k -C .. 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
+// End: