public static pypy.runtime.List <string> ll_os_listdir(string path) { if (path == "") { Helpers.raise_OSError(Errno.ENOENT); } DirectoryInfo dir = new DirectoryInfo(path); if (!dir.Exists) { Helpers.raise_OSError(Errno.ENOENT); } pypy.runtime.List <string> names = new pypy.runtime.List <string>(); foreach (DirectoryInfo d in dir.GetDirectories()) { names.Add(d.Name); } foreach (FileInfo f in dir.GetFiles()) { names.Add(f.Name); } return(names); }
public static pypy.runtime.List <string> ll_os_envkeys() { pypy.runtime.List <string> keys = new pypy.runtime.List <string>(); foreach (DictionaryEntry entry in Environment.GetEnvironmentVariables()) { keys.Add((string)entry.Key); } return(keys); }
public static pypy.runtime.List <Record_String_String> ll_os_envitems() { pypy.runtime.List <Record_String_String> env = new pypy.runtime.List <Record_String_String>(); foreach (DictionaryEntry entry in Environment.GetEnvironmentVariables()) { Record_String_String var = new Record_String_String(); var.item0 = (string)entry.Key; var.item1 = (string)entry.Value; env.Add(var); } return(env); }
public static pypy.runtime.List<string> ll_os_listdir(string path) { if (path == "") Helpers.raise_OSError(Errno.ENOENT); DirectoryInfo dir = new DirectoryInfo(path); if (!dir.Exists) Helpers.raise_OSError(Errno.ENOENT); pypy.runtime.List<string> names = new pypy.runtime.List<string>(); foreach(DirectoryInfo d in dir.GetDirectories()) names.Add(d.Name); foreach(FileInfo f in dir.GetFiles()) names.Add(f.Name); return names; }
public static pypy.runtime.List<string> ll_os_envkeys() { pypy.runtime.List<string> keys = new pypy.runtime.List<string>(); foreach (DictionaryEntry entry in Environment.GetEnvironmentVariables()) keys.Add((string)entry.Key); return keys; }
public static pypy.runtime.List<Record_String_String> ll_os_envitems() { pypy.runtime.List<Record_String_String> env = new pypy.runtime.List<Record_String_String>(); foreach (DictionaryEntry entry in Environment.GetEnvironmentVariables()) { Record_String_String var = new Record_String_String(); var.item0 = (string)entry.Key; var.item1 = (string)entry.Value; env.Add(var); } return env; }