CSKernelFile.cFile.save C# (CSharp) Method

save() public method

public save ( string fullFileName, bool &exists, bool &readOnly, string description ) : bool
fullFileName string
exists bool
readOnly bool
description string
return bool
        public bool save(string fullFileName,
                         out bool exists,
                         out bool readOnly,
                         string description)
        {
            exists = false;
            readOnly = false;

            if (fullFileName.Length == 0)
            {
                fullFileName = " ";
            }
            if (userSearchFile(ref fullFileName, true, description, true, false))
            {
                if (fullFileName.Length > 0)
                {
                    FileInfo fi = new FileInfo(fullFileName);
                    exists = fi.Exists;
                    if (exists)
                    {
                        if ((fi.Attributes & FileAttributes.Normal
                             | fi.Attributes & FileAttributes.ReadOnly
                             | fi.Attributes & FileAttributes.Archive) != 0)
                        {
                            if ((fi.Attributes & FileAttributes.ReadOnly) != 0)
                            {
                                readOnly = true;
                            }
                        }
                        else
                        {
                            exists = false;
                        }
                    }
                }
                else
                {
                    fullFileName = " ";
                    exists = false;
                }
            }
            return true;
        }