Пример #1
0
        internal static unsafe FileSystemInfo Create(string fullPath, string fileName, ref FileStatus fileStatus)
        {
            FileSystemInfo info = fileStatus.InitiallyDirectory
                ? (FileSystemInfo) new DirectoryInfo(fullPath, fileName: fileName, isNormalized: true)
                : new FileInfo(fullPath, fileName: fileName, isNormalized: true);

            Debug.Assert(!PathInternal.IsPartiallyQualified(fullPath), $"'{fullPath}' should be fully qualified when constructed from directory enumeration");

            info.Init(ref fileStatus);
            return(info);
        }
Пример #2
0
 internal unsafe void Init(ref FileStatus fileStatus)
 {
     _fileStatus = fileStatus;
     _fileStatus.EnsureStatInitialized(FullPath);
 }
Пример #3
0
 protected FileSystemInfo()
 {
     FileStatus.Initialize(ref _fileStatus, this is DirectoryInfo);
 }