コード例 #1
0
ファイル: File.cs プロジェクト: yuyixiaoxiang/mono
        public static void SetAttributes(string path,
                                         FileAttributes fileAttributes)
        {
            MonoIOError error;

            Path.Validate(path);

            if (!MonoIO.SetFileAttributes(path, fileAttributes, out error))
            {
                throw MonoIO.GetException(path, error);
            }
        }
コード例 #2
0
        public static void SetAttributes(string path, FileAttributes fileAttributes)
        {
#if MONO
            if (((uint)fileAttributes & 0x80000000) != 0)
            {
                MonoIOError error;
                Path.Validate(path);

                if (!MonoIO.SetFileAttributes(path, fileAttributes, out error))
                {
                    throw MonoIO.GetException(path, error);
                }
                return;
            }
#endif
            string fullPath = Path.GetFullPath(path);
            FileSystem.SetAttributes(fullPath, fileAttributes);
        }