Fan.Sys.Pod.readFPod C# (CSharp) Method

readFPod() public static method

public static readFPod ( string name ) : FPod
name string
return Fanx.Fcode.FPod
        public static FPod readFPod(string name)
        {
            FStore store = null;

              // handle sys specially for bootstrapping the VM
              if (name == "sys")
              {
            store = new FStore(new ZipFile(FileUtil.combine(Sys.m_podsDir, name + ".pod")));
              }

              // otherwise delegate to Env.cur to find the pod file
              else
              {
            FileSystemInfo file = null;
            Fan.Sys.File f = Env.cur().findPodFile(name);
            if (f != null) file = ((LocalFile)f).m_file;

            // if null or doesn't exist then its a no go
            if (file == null || !file.Exists) throw UnknownPodErr.make(name).val;

            // verify case since Windoze is case insensitive
            String actualName = file.Name; //getCanonicalFile().getName();
            actualName = actualName.Substring(0, actualName.Length-4);
            if (actualName != name) throw UnknownPodErr.make("Mismatch case: " + name + " != " + actualName).val;

            store = new FStore(new ZipFile(file.FullName));
              }

              // read in the FPod tables
              FPod fpod = new FPod(name, store);
              fpod.read();
              return fpod;
        }