Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 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;
 }