Browse Source

Merge branch 'genpy' of github.com:Simn/haxe into genpy

frabbit 11 years ago
parent
commit
0c9b15e4bc
2 changed files with 10 additions and 10 deletions
  1. 1 1
      genpy.ml
  2. 9 9
      std/python/_std/sys/FileSystem.hx

+ 1 - 1
genpy.ml

@@ -1764,7 +1764,7 @@ module Generator = struct
 
 	let gen_resources ctx =
 		if Hashtbl.length ctx.com.resources > 0 then begin
-			spr ctx "import os;\ndef _hx_resources__():\n\treturn {";
+			spr ctx "def _hx_resources__():\n\treturn {";
 			let first = ref true in
 			Hashtbl.iter (fun k v ->
 				let prefix = if !first then begin

+ 9 - 9
std/python/_std/sys/FileSystem.hx

@@ -60,20 +60,20 @@ class FileSystem {
 	{
 		return Path.isdir(path);
 	}
-	public static function createDirectory( path : String ) : Void
-	{
-		Os.mkdir(path);
+
+	public static function createDirectory( path : String ) : Void {
+		Os.makedirs(path, 511, true);
 	}
-	public static function deleteFile( path : String ) : Void
-	{
+
+	public static function deleteFile( path : String ) : Void {
 		Os.remove(path);
 	}
-	public static function deleteDirectory( path : String ) : Void
-	{
+
+	public static function deleteDirectory( path : String ) : Void {
 		Os.rmdir(path);
 	}
-	public static function readDirectory( path : String ) : Array<String>
-	{
+
+	public static function readDirectory( path : String ) : Array<String> {
 		return Os.listdir(path);
 	}