Fan.Sys.LocalFile.createFile C# (CSharp) Method

createFile() private method

private createFile ( ) : void
return void
        private void createFile()
        {
            if (m_file.Exists)
              {
            if (m_file is DirectoryInfo)
              throw IOErr.make("Already exists as dir: " + m_file).val;
              }
              else
              {
            DirectoryInfo parent = (m_file as FileInfo).Directory;
            if (!parent.Exists)
            {
              try
              {
            System.IO.Directory.CreateDirectory(parent.FullName);
              }
              catch (System.Exception e)
              {
            throw IOErr.make("Cannot create dir: " + parent, e).val;
              }
            }

            try
            {
              // TODO - not sure how this should work yet
              FileStream fs = (m_file as FileInfo).Create();
              fs.Close();
              m_file.Refresh();
            }
            catch (System.IO.IOException e)
            {
              throw IOErr.make(e).val;
            }
              }
        }