├── .editorconfig ├── .gitattributes ├── .gitignore ├── AlphaFS.sln ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── appveyor.deploy-docs.yml ├── appveyor.yml ├── build.cake ├── build.ps1 ├── build ├── AlphaFS.snk ├── appveyor-util.cake ├── common.cake ├── common.props ├── git-util.cake └── rest-util.cake ├── cake.config ├── docs ├── .gitignore ├── api │ ├── .gitignore │ └── index.md ├── apidoc │ └── namespaces │ │ ├── Alphaleonis.Win32.FileSystem.md │ │ ├── Alphaleonis.Win32.Network.md │ │ ├── Alphaleonis.Win32.Security.md │ │ └── Alphaleonis.Win32.md ├── articles │ ├── differences.md │ ├── exceptions.md │ ├── intro.md │ ├── methods-without-long-path-support.md │ ├── powershell │ │ ├── examples.md │ │ ├── intro.md │ │ └── toc.yml │ └── toc.yml ├── docfx.json ├── images │ └── logo.svg ├── index.md ├── theme │ └── alphaleonis │ │ └── styles │ │ └── main.css └── toc.yml ├── samples └── PowerShell │ ├── Copy-DirectoryWithProgress.ps1 │ ├── Copy-FileWithProgress.ps1 │ └── Enumerate-FileSystemEntryInfos.ps1 ├── src └── AlphaFS │ ├── AlphaFS.csproj │ ├── AlphaFS.ruleset │ ├── AssemblyVersionInfo.cs │ ├── Device │ ├── ChangeErrorMode.cs │ ├── Device.cs │ ├── DeviceInfo.cs │ ├── DiskSpaceInfo.cs │ ├── DriveInfo.cs │ └── Volume │ │ ├── Volume.DefineDosDevice.cs │ │ ├── Volume.DeleteDosDevice.cs │ │ ├── Volume.DeleteVolumeMountPoint.cs │ │ ├── Volume.DiskFreeSpace.cs │ │ ├── Volume.DriveType.cs │ │ ├── Volume.EnumerateVolumeMountPoints.cs │ │ ├── Volume.EnumerateVolumePathNames.cs │ │ ├── Volume.EnumerateVolumes.cs │ │ ├── Volume.GetDriveFormat.cs │ │ ├── Volume.GetDriveNameForNtDeviceName.cs │ │ ├── Volume.GetUniqueVolumeNameForPath.cs │ │ ├── Volume.GetVolumeDeviceName.cs │ │ ├── Volume.GetVolumeDisplayName.cs │ │ ├── Volume.GetVolumeGuid.cs │ │ ├── Volume.GetVolumeGuidForNtDeviceName.cs │ │ ├── Volume.GetVolumeInfo.cs │ │ ├── Volume.GetVolumePathName.cs │ │ ├── Volume.IsReady.cs │ │ ├── Volume.IsSameVolume.cs │ │ ├── Volume.IsVolume.cs │ │ ├── Volume.QueryDosDevice.cs │ │ ├── Volume.SetVolumeMountPoint.cs │ │ ├── Volume.VolumeLabel.cs │ │ ├── Volume.cs │ │ └── VolumeInfo.cs │ ├── Filesystem │ ├── ByHandleFileInfo.cs │ ├── CopyMoveArguments.cs │ ├── CopyMoveProgressRoutine.cs │ ├── CopyMoveResult.cs │ ├── Directory Class │ │ ├── Directory Compression │ │ │ ├── Directory.Compress.cs │ │ │ ├── Directory.CompressTransacted.cs │ │ │ ├── Directory.Decompress.cs │ │ │ ├── Directory.DecompressTransacted.cs │ │ │ ├── Directory.DisableCompression.cs │ │ │ ├── Directory.DisableCompressionTransacted.cs │ │ │ ├── Directory.EnableCompression.cs │ │ │ └── Directory.EnableCompressionTransacted.cs │ │ ├── Directory CopyMove │ │ │ ├── Directory.Copy.cs │ │ │ ├── Directory.CopyFolderTimestamps.cs │ │ │ ├── Directory.CopyTransacted.cs │ │ │ ├── Directory.Move.cs │ │ │ ├── Directory.MoveTransacted.cs │ │ │ └── Directory.ValidateMoveAction.cs │ │ ├── Directory Core Methods │ │ │ ├── Directory.CompressDecompressCore.cs │ │ │ ├── Directory.CopyMoveCore.cs │ │ │ ├── Directory.CopyMoveDirectoryCore.cs │ │ │ ├── Directory.CreateDirectoryCore.cs │ │ │ ├── Directory.CreateJunctionCore.cs │ │ │ ├── Directory.DeleteDirectoryCore.cs │ │ │ ├── Directory.DeleteDirectoryNative.cs │ │ │ ├── Directory.DeleteEmptySubdirectoriesCore.cs │ │ │ ├── Directory.DeleteJunctionCore.cs │ │ │ ├── Directory.EnableDisableEncryptionCore.cs │ │ │ ├── Directory.EncryptDecryptDirectoryCore.cs │ │ │ ├── Directory.EnumerateFileIdBothDirectoryInfoCore.cs │ │ │ ├── Directory.EnumerateFileSystemEntryInfosCore.cs │ │ │ ├── Directory.ExistsJunctionCore.cs │ │ │ ├── Directory.GetDirectoryRootCore.cs │ │ │ ├── Directory.GetParentCore.cs │ │ │ ├── Directory.GetPropertiesCore.cs │ │ │ ├── Directory.GetSizeCore.cs │ │ │ └── Directory.IsEmptyCore.cs │ │ ├── Directory Encryption │ │ │ ├── Directory.Decrypt.cs │ │ │ ├── Directory.DisableEncryption.cs │ │ │ ├── Directory.EnableEncryption.cs │ │ │ ├── Directory.Encrypt.cs │ │ │ ├── Directory.ExportEncryptedDirectoryRaw.cs │ │ │ └── Directory.ImportEncryptedDirectoryRaw.cs │ │ ├── Directory Junctions, Links │ │ │ ├── Directory.CreateJunction.cs │ │ │ ├── Directory.CreateJunctionTransacted.cs │ │ │ ├── Directory.CreateSymbolicLink.cs │ │ │ ├── Directory.CreateSymbolicLinkTransacted.cs │ │ │ ├── Directory.DeleteJunction.cs │ │ │ ├── Directory.DeleteJunctionTransacted.cs │ │ │ ├── Directory.ExistsJunction.cs │ │ │ └── Directory.ExistsJunctionTransacted.cs │ │ ├── Directory Time │ │ │ ├── Directory.CopyTimestamps.cs │ │ │ ├── Directory.CopyTimestampsTransacted.cs │ │ │ ├── Directory.GetChangeTime.cs │ │ │ ├── Directory.GetChangeTimeTransacted.cs │ │ │ ├── Directory.GetChangeTimeUtc.cs │ │ │ ├── Directory.GetChangeTimeUtcTransacted.cs │ │ │ ├── Directory.GetCreationTime.cs │ │ │ ├── Directory.GetCreationTimeTransacted.cs │ │ │ ├── Directory.GetCreationTimeUtc.cs │ │ │ ├── Directory.GetCreationTimeUtcTransacted.cs │ │ │ ├── Directory.GetLastAccessTime.cs │ │ │ ├── Directory.GetLastAccessTimeTransacted.cs │ │ │ ├── Directory.GetLastAccessTimeUtc.cs │ │ │ ├── Directory.GetLastAccessTimeUtcTransacted.cs │ │ │ ├── Directory.GetLastWriteTime.cs │ │ │ ├── Directory.GetLastWriteTimeTransacted.cs │ │ │ ├── Directory.GetLastWriteTimeUtc.cs │ │ │ ├── Directory.GetLastWriteTimeUtcTransacted.cs │ │ │ ├── Directory.SetCreationTime.cs │ │ │ ├── Directory.SetCreationTimeTransacted.cs │ │ │ ├── Directory.SetCreationTimeUtc.cs │ │ │ ├── Directory.SetCreationTimeUtcTransacted.cs │ │ │ ├── Directory.SetLastAccessTime.cs │ │ │ ├── Directory.SetLastAccessTimeTransacted.cs │ │ │ ├── Directory.SetLastAccessTimeUtc.cs │ │ │ ├── Directory.SetLastAccessTimeUtcTransacted.cs │ │ │ ├── Directory.SetLastWriteTime.cs │ │ │ ├── Directory.SetLastWriteTimeTransacted.cs │ │ │ ├── Directory.SetLastWriteTimeUtc.cs │ │ │ ├── Directory.SetLastWriteTimeUtcTransacted.cs │ │ │ └── Directory.SetTimestamps.cs │ │ ├── Directory.CountFileSystemObjects.cs │ │ ├── Directory.CountFileSystemObjectsTransacted.cs │ │ ├── Directory.CreateDirectory.cs │ │ ├── Directory.CreateDirectoryTransacted.cs │ │ ├── Directory.Delete.cs │ │ ├── Directory.DeleteEmptySubdirectories.cs │ │ ├── Directory.DeleteEmptySubdirectoriesTransacted.cs │ │ ├── Directory.DeleteTransacted.cs │ │ ├── Directory.EnumerateAlternateDataStreams.cs │ │ ├── Directory.EnumerateAlternateDataStreamsTransacted.cs │ │ ├── Directory.EnumerateDirectories.cs │ │ ├── Directory.EnumerateDirectoriesTransacted.cs │ │ ├── Directory.EnumerateFileIdBothDirectoryInfo.cs │ │ ├── Directory.EnumerateFileIdBothDirectoryInfoTransacted.cs │ │ ├── Directory.EnumerateFileSystemEntries.cs │ │ ├── Directory.EnumerateFileSystemEntriesTransacted.cs │ │ ├── Directory.EnumerateFileSystemEntryInfos.cs │ │ ├── Directory.EnumerateFileSystemEntryInfosTransacted.cs │ │ ├── Directory.EnumerateFiles.cs │ │ ├── Directory.EnumerateFilesTransacted.cs │ │ ├── Directory.EnumerateLogicalDrives.cs │ │ ├── Directory.Exists.cs │ │ ├── Directory.ExistsDrive.cs │ │ ├── Directory.ExistsTransacted.cs │ │ ├── Directory.GetAccessControl.cs │ │ ├── Directory.GetCurrentDirectory.cs │ │ ├── Directory.GetDirectories.cs │ │ ├── Directory.GetDirectoriesTransacted.cs │ │ ├── Directory.GetDirectoryRoot.cs │ │ ├── Directory.GetDirectoryRootTransacted.cs │ │ ├── Directory.GetFileIdInfo.cs │ │ ├── Directory.GetFileIdInfoTransacted.cs │ │ ├── Directory.GetFileInfoByHandle.cs │ │ ├── Directory.GetFileInfoByHandleTransacted.cs │ │ ├── Directory.GetFileSystemEntries.cs │ │ ├── Directory.GetFileSystemEntriesTransacted.cs │ │ ├── Directory.GetFileSystemEntryInfo.cs │ │ ├── Directory.GetFileSystemEntryInfoTransacted.cs │ │ ├── Directory.GetFiles.cs │ │ ├── Directory.GetFilesTransacted.cs │ │ ├── Directory.GetLinkTargetInfo.cs │ │ ├── Directory.GetLinkTargetInfoTransacted.cs │ │ ├── Directory.GetLogicalDrives.cs │ │ ├── Directory.GetParent.cs │ │ ├── Directory.GetParentTransacted.cs │ │ ├── Directory.GetProperties.cs │ │ ├── Directory.GetPropertiesTransacted.cs │ │ ├── Directory.GetSize.cs │ │ ├── Directory.GetSizeTransacted.cs │ │ ├── Directory.HasInheritedPermissions.cs │ │ ├── Directory.IsEmpty.cs │ │ ├── Directory.IsEmptyTransacted.cs │ │ ├── Directory.SetAccessControl.cs │ │ ├── Directory.SetCurrentDirectory.cs │ │ └── Directory.cs │ ├── DirectoryInfo Class │ │ ├── DirectoryInfo Compression │ │ │ ├── DirectoryInfo.Compress.cs │ │ │ ├── DirectoryInfo.Decompress.cs │ │ │ ├── DirectoryInfo.DisableCompression.cs │ │ │ └── DirectoryInfo.EnableCompression.cs │ │ ├── DirectoryInfo CopyToMoveTo │ │ │ ├── DirectoryInfo.CopyTo.cs │ │ │ ├── DirectoryInfo.CopyToMoveToCore.cs │ │ │ └── DirectoryInfo.MoveTo.cs │ │ ├── DirectoryInfo Encryption │ │ │ ├── DirectoryInfo.Decrypt.cs │ │ │ ├── DirectoryInfo.DisableEncryption.cs │ │ │ ├── DirectoryInfo.EnableEncryption.cs │ │ │ └── DirectoryInfo.Encrypt.cs │ │ ├── DirectoryInfo Junctions, Links │ │ │ ├── DirectoryInfo.CreateJunction.cs │ │ │ ├── DirectoryInfo.DeleteJunction.cs │ │ │ └── DirectoryInfo.ExistsJunction.cs │ │ ├── DirectoryInfo.CountFileSystemObjects.cs │ │ ├── DirectoryInfo.Create.cs │ │ ├── DirectoryInfo.CreateSubdirectory.cs │ │ ├── DirectoryInfo.CreateSubdirectoryCore.cs │ │ ├── DirectoryInfo.Delete.cs │ │ ├── DirectoryInfo.DeleteEmptySubdirectories.cs │ │ ├── DirectoryInfo.EnumerateAlternateDataStreams.cs │ │ ├── DirectoryInfo.EnumerateDirectories.cs │ │ ├── DirectoryInfo.EnumerateFileSystemInfos.cs │ │ ├── DirectoryInfo.EnumerateFiles.cs │ │ ├── DirectoryInfo.GetAccessControl.cs │ │ ├── DirectoryInfo.GetDirectories.cs │ │ ├── DirectoryInfo.GetFileIdInfo.cs │ │ ├── DirectoryInfo.GetFileSystemInfos.cs │ │ ├── DirectoryInfo.GetFiles.cs │ │ ├── DirectoryInfo.RefreshEntryInfo.cs │ │ ├── DirectoryInfo.SetAccessControl.cs │ │ └── DirectoryInfo.cs │ ├── Exceptions │ │ ├── AlreadyExistsException.cs │ │ ├── DeviceNotReadyException.cs │ │ ├── DirectoryNotEmptyException.cs │ │ ├── DirectoryReadOnlyException.cs │ │ ├── FileReadOnlyException.cs │ │ ├── InvalidTransactionException.cs │ │ ├── NotAReparsePointException.cs │ │ ├── NotSameDeviceException.cs │ │ ├── TransactionAlreadyAbortedException.cs │ │ ├── TransactionAlreadyCommittedException.cs │ │ ├── TransactionException.cs │ │ ├── TransactionalConflictException.cs │ │ ├── UnrecognizedReparsePointException.cs │ │ └── UnsupportedRemoteTransactionException.cs │ ├── File Class │ │ ├── File Compression │ │ │ ├── File.Compress.cs │ │ │ ├── File.CompressTransacted.cs │ │ │ ├── File.Decompress.cs │ │ │ ├── File.DecompressTransacted.cs │ │ │ ├── File.GetCompressedSize.cs │ │ │ └── File.GetCompressedSizeTransacted.cs │ │ ├── File CopyMove │ │ │ ├── File.Copy.cs │ │ │ ├── File.CopyMoveLogic.cs │ │ │ ├── File.CopyMoveNative.cs │ │ │ ├── File.CopyTransacted.cs │ │ │ ├── File.Move.cs │ │ │ ├── File.MoveTransacted.cs │ │ │ ├── File.RestartMoveOrThrowException.cs │ │ │ ├── File.ValidateFileOrDirectoryMoveArguments.cs │ │ │ └── File.VerifyDelayUntilReboot.cs │ │ ├── File Core Methods │ │ │ ├── File.AppendTextCore.cs │ │ │ ├── File.CopyMoveCore.cs │ │ │ ├── File.CopyTimestampsCore.cs │ │ │ ├── File.CreateFileCore.cs │ │ │ ├── File.CreateFileStreamCore.cs │ │ │ ├── File.CreateHardlinkCore.cs │ │ │ ├── File.CreateSymbolicLinkCore.cs │ │ │ ├── File.CreateTextCore.cs │ │ │ ├── File.DeleteFileCore.cs │ │ │ ├── File.EncryptDecryptFileCore.cs │ │ │ ├── File.EnumerateAlternateDataStreamsCore.cs │ │ │ ├── File.EnumerateHardLinksCore.cs │ │ │ ├── File.ExistsCore.cs │ │ │ ├── File.FindAllStreamsCore.cs │ │ │ ├── File.GetAccessControlCore.cs │ │ │ ├── File.GetAttributesExCore.cs │ │ │ ├── File.GetChangeTimeCore.cs │ │ │ ├── File.GetCompressedSizeCore.cs │ │ │ ├── File.GetCreationTimeCore.cs │ │ │ ├── File.GetEncryptionStatusCore.cs │ │ │ ├── File.GetFileIdInfoCore.cs │ │ │ ├── File.GetFileInfoByHandleCore.cs │ │ │ ├── File.GetFileSystemEntryInfoCore.cs │ │ │ ├── File.GetHashCore.cs │ │ │ ├── File.GetLastAccessTimeCore.cs │ │ │ ├── File.GetLastWriteTimeCore.cs │ │ │ ├── File.GetLinkTargetInfoCore.cs │ │ │ ├── File.GetProcessForFileLockCore.cs │ │ │ ├── File.GetSizeCore.cs │ │ │ ├── File.ImportExportEncryptedFileDirectoryRawCore.cs │ │ │ ├── File.IsLockedCore.cs │ │ │ ├── File.OpenCore.cs │ │ │ ├── File.ReadAllBytesCore.cs │ │ │ ├── File.ReadAllLinesCore.cs │ │ │ ├── File.ReadAllTextCore.cs │ │ │ ├── File.ReadLinesCore.cs │ │ │ ├── File.ReplaceCore.cs │ │ │ ├── File.SetAccessControlCore.cs │ │ │ ├── File.SetAttributesCore.cs │ │ │ ├── File.SetFsoDateTimeCore.cs │ │ │ ├── File.WriteAllBytesCore.cs │ │ │ └── File.WriteAppendAllLinesCore.cs │ │ ├── File Encryption │ │ │ ├── File.Decrypt.cs │ │ │ ├── File.Encrypt.cs │ │ │ ├── File.ExportEncryptedFileRaw.cs │ │ │ ├── File.GetEncryptionStatus.cs │ │ │ └── File.ImportEncryptedFileRaw.cs │ │ ├── File Junctions, Links │ │ │ ├── File.CreateHardLink.cs │ │ │ ├── File.CreateHardLinkTransacted.cs │ │ │ ├── File.CreateSymbolicLink.cs │ │ │ ├── File.CreateSymbolicLinkTransacted.cs │ │ │ ├── File.EnumerateHardLinks.cs │ │ │ ├── File.EnumerateHardLinksTransacted.cs │ │ │ ├── File.GetLinkTargetInfo.cs │ │ │ └── File.GetLinkTargetInfoTransacted.cs │ │ ├── File Time │ │ │ ├── File.CopyTimestamps.cs │ │ │ ├── File.CopyTimestampsTransacted.cs │ │ │ ├── File.GetChangeTime.cs │ │ │ ├── File.GetChangeTimeTransacted.cs │ │ │ ├── File.GetChangeTimeUtc.cs │ │ │ ├── File.GetChangeTimeUtcTransacted.cs │ │ │ ├── File.GetCreationTime.cs │ │ │ ├── File.GetCreationTimeTransacted.cs │ │ │ ├── File.GetCreationTimeUtc.cs │ │ │ ├── File.GetCreationTimeUtcTransacted.cs │ │ │ ├── File.GetLastAccessTime.cs │ │ │ ├── File.GetLastAccessTimeTransacted.cs │ │ │ ├── File.GetLastAccessTimeUtc.cs │ │ │ ├── File.GetLastAccessTimeUtcTransacted.cs │ │ │ ├── File.GetLastWriteTime.cs │ │ │ ├── File.GetLastWriteTimeTransacted.cs │ │ │ ├── File.GetLastWriteTimeUtc.cs │ │ │ ├── File.GetLastWriteTimeUtcTransacted.cs │ │ │ ├── File.SetCreationTime.cs │ │ │ ├── File.SetCreationTimeTransacted.cs │ │ │ ├── File.SetCreationTimeUtc.cs │ │ │ ├── File.SetCreationTimeUtcTransacted.cs │ │ │ ├── File.SetLastAccessTime.cs │ │ │ ├── File.SetLastAccessTimeTransacted.cs │ │ │ ├── File.SetLastAccessTimeUtc.cs │ │ │ ├── File.SetLastAccessTimeUtcTransacted.cs │ │ │ ├── File.SetLastWriteTime.cs │ │ │ ├── File.SetLastWriteTimeTransacted.cs │ │ │ ├── File.SetLastWriteTimeUtc.cs │ │ │ ├── File.SetLastWriteTimeUtcTransacted.cs │ │ │ ├── File.SetTimestamps.cs │ │ │ ├── File.SetTimestampsTransacted.cs │ │ │ ├── File.SetTimestampsUtc.cs │ │ │ └── File.SetTimestampsUtcTransacted.cs │ │ ├── File.AppendAllLines.cs │ │ ├── File.AppendAllLinesTransacted.cs │ │ ├── File.AppendAllText.cs │ │ ├── File.AppendAllTextTransacted.cs │ │ ├── File.AppendText.cs │ │ ├── File.AppendTextTransacted.cs │ │ ├── File.AttributeLogic.cs │ │ ├── File.Create.cs │ │ ├── File.CreateText.cs │ │ ├── File.CreateTextTransacted.cs │ │ ├── File.CreateTransacted.cs │ │ ├── File.Delete.cs │ │ ├── File.DeleteTransacted.cs │ │ ├── File.EnumerateAlternateDataStreams.cs │ │ ├── File.EnumerateAlternateDataStreamsTransacted.cs │ │ ├── File.Exists.cs │ │ ├── File.ExistsTransacted.cs │ │ ├── File.FindFirstStreamNative.cs │ │ ├── File.GetAccessControl.cs │ │ ├── File.GetAttributes.cs │ │ ├── File.GetAttributesTransacted.cs │ │ ├── File.GetFileIdInfo.cs │ │ ├── File.GetFileIdInfoTransacted.cs │ │ ├── File.GetFileInfoByHandle.cs │ │ ├── File.GetFileInfoByHandleTransacted.cs │ │ ├── File.GetFileSystemEntryInfo.cs │ │ ├── File.GetFileSystemEntryInfoTransacted.cs │ │ ├── File.GetHash.cs │ │ ├── File.GetHashTransacted.cs │ │ ├── File.GetProcessForFileLock.cs │ │ ├── File.GetProcessForFileLockTransacted.cs │ │ ├── File.GetSize.cs │ │ ├── File.GetSizeTransacted.cs │ │ ├── File.IsLocked.cs │ │ ├── File.IsLockedTransacted.cs │ │ ├── File.Open.cs │ │ ├── File.OpenBackupRead.cs │ │ ├── File.OpenBackupReadTransacted.cs │ │ ├── File.OpenRead.cs │ │ ├── File.OpenReadTransacted.cs │ │ ├── File.OpenText.cs │ │ ├── File.OpenTextTransacted.cs │ │ ├── File.OpenTransacted.cs │ │ ├── File.OpenWrite.cs │ │ ├── File.OpenWriteTransacted.cs │ │ ├── File.ReadAllBytes.cs │ │ ├── File.ReadAllBytesTransacted.cs │ │ ├── File.ReadAllLines.cs │ │ ├── File.ReadAllLinesTransacted.cs │ │ ├── File.ReadAllText.cs │ │ ├── File.ReadAllTextTransacted.cs │ │ ├── File.ReadLines.cs │ │ ├── File.ReadLinesTransacted.cs │ │ ├── File.Replace.cs │ │ ├── File.SetAccessControl.cs │ │ ├── File.SetAttributes.cs │ │ ├── File.SetAttributesTransacted.cs │ │ ├── File.ThrowIOExceptionIfFsoExist.cs │ │ ├── File.WriteAllBytes.cs │ │ ├── File.WriteAllBytesTransacted.cs │ │ ├── File.WriteAllLines.cs │ │ ├── File.WriteAllLinesTransacted.cs │ │ ├── File.WriteAllText.cs │ │ ├── File.WriteAllTextTransacted.cs │ │ └── File.cs │ ├── FileIdBothDirectoryInfo.cs │ ├── FileInfo Class │ │ ├── FileInfo Compression │ │ │ ├── FileInfo.Compress.cs │ │ │ └── FileInfo.Decompress.cs │ │ ├── FileInfo CopyToMoveTo │ │ │ ├── FileInfo.CopyTo.cs │ │ │ ├── FileInfo.CopyToMoveToCore.cs │ │ │ └── FileInfo.MoveTo.cs │ │ ├── FileInfo Encryption │ │ │ ├── FileInfo.Decrypt.cs │ │ │ └── FileInfo.Encrypt.cs │ │ ├── FileInfo.AppendText.cs │ │ ├── FileInfo.Create.cs │ │ ├── FileInfo.CreateText.cs │ │ ├── FileInfo.Delete.cs │ │ ├── FileInfo.EnumerateAlternateDataStreams.cs │ │ ├── FileInfo.GetAccessControl.cs │ │ ├── FileInfo.GetFileIdInfo.cs │ │ ├── FileInfo.GetHash.cs │ │ ├── FileInfo.IsLocked.cs │ │ ├── FileInfo.Open.cs │ │ ├── FileInfo.OpenRead.cs │ │ ├── FileInfo.OpenText.cs │ │ ├── FileInfo.OpenWrite.cs │ │ ├── FileInfo.RefreshEntryInfo.cs │ │ ├── FileInfo.Replace.cs │ │ ├── FileInfo.SetAccessControl.cs │ │ └── FileInfo.cs │ ├── FileSystemEntryInfo.cs │ ├── FileSystemInfo.cs │ ├── FindFileSystemEntryInfo.cs │ ├── KernelTransaction.cs │ ├── Link Stream │ │ ├── AlternateDataStreamInfo.cs │ │ ├── BackupFileStream.cs │ │ ├── BackupStreamInfo.cs │ │ ├── LinkTargetInfo.cs │ │ └── SymbolicLinkTargetInfo.cs │ ├── Native Methods │ │ ├── NativeMethods.BackupStreams.cs │ │ ├── NativeMethods.Constants.cs │ │ ├── NativeMethods.DeviceManagement.cs │ │ ├── NativeMethods.DirectoryManagement.cs │ │ ├── NativeMethods.DiskManagement.cs │ │ ├── NativeMethods.EncryptedFileRaw.cs │ │ ├── NativeMethods.FileManagement.cs │ │ ├── NativeMethods.Handles.cs │ │ ├── NativeMethods.KernelTransactions.cs │ │ ├── NativeMethods.PathManagement.cs │ │ ├── NativeMethods.Shell32.cs │ │ ├── NativeMethods.Utilities.cs │ │ └── NativeMethods.VolumeManagement.cs │ ├── Native Other │ │ ├── BY_HANDLE_FILE_INFORMATION.cs │ │ ├── COPY_FILE_FLAGS.cs │ │ ├── FILETIME.cs │ │ ├── FILE_BASIC_INFO.cs │ │ ├── FILE_ID_BOTH_DIR_INFO.cs │ │ ├── FILE_ID_INFO.cs │ │ ├── FILE_INFO_BY_HANDLE_CLASS.cs │ │ ├── FINDEX_INFO_LEVELS.cs │ │ ├── FINDEX_SEARCH_OPS.cs │ │ ├── FIND_FIRST_EX_FLAGS.cs │ │ ├── GET_FILEEX_INFO_LEVELS.cs │ │ ├── MOVE_FILE_FLAGS.cs │ │ ├── MountPointReparseBuffer.cs │ │ ├── REPARSE_DATA_BUFFER.cs │ │ ├── ReparseDataBufferHeader.cs │ │ ├── SP_DEVICE_INTERFACE_DATA.cs │ │ ├── SP_DEVICE_INTERFACE_DETAIL_DATA.cs │ │ ├── SP_DEVINFO_DATA.cs │ │ ├── STREAM_ATTRIBUTE.cs │ │ ├── STREAM_ID.cs │ │ ├── STREAM_INFO_LEVELS.cs │ │ ├── SymbolicLinkReparseBuffer.cs │ │ ├── VOLUME_INFO_FLAGS.cs │ │ ├── WIN32_FILE_ATTRIBUTE_DATA.cs │ │ ├── WIN32_FIND_DATA.cs │ │ ├── WIN32_FIND_STREAM_DATA.cs │ │ └── WIN32_STREAM_ID.cs │ ├── Path Class │ │ ├── Path Core Methods │ │ │ ├── Path.AddTrailingDirectorySeparatorCore.cs │ │ │ ├── Path.CombineCore.cs │ │ │ ├── Path.GetDirectoryNameCore.cs │ │ │ ├── Path.GetDirectoryNameWithoutRootCore.cs │ │ │ ├── Path.GetExtensionCore.cs │ │ │ ├── Path.GetFileNameCore.cs │ │ │ ├── Path.GetFileNameWithoutExtensionCore.cs │ │ │ ├── Path.GetFinalPathNameByHandleCore.cs │ │ │ ├── Path.GetFullPathCore.cs │ │ │ ├── Path.GetLongPathCore.cs │ │ │ ├── Path.GetLongShort83PathCore.cs │ │ │ ├── Path.GetPathRootCore.cs │ │ │ ├── Path.GetRegularPathCore.cs │ │ │ ├── Path.GetSuffixedDirectoryNameCore.cs │ │ │ ├── Path.GetSuffixedDirectoryNameWithoutRootCore.cs │ │ │ ├── Path.GetTempPathCore.cs │ │ │ ├── Path.IsPathRootedCore.cs │ │ │ ├── Path.IsUncPathCore.cs │ │ │ ├── Path.LocalToUncCore.cs │ │ │ └── Path.RemoveTrailingDirectorySeparatorCore.cs │ │ ├── Path.AddTrailingDirectorySeparator.cs │ │ ├── Path.ChangeExtension.cs │ │ ├── Path.Combine.cs │ │ ├── Path.Constants.cs │ │ ├── Path.GetDirectoryName.cs │ │ ├── Path.GetDirectoryNameWithoutRoot.cs │ │ ├── Path.GetDirectoryNameWithoutRootTransacted.cs │ │ ├── Path.GetExtension.cs │ │ ├── Path.GetFileName.cs │ │ ├── Path.GetFileNameWithoutExtension.cs │ │ ├── Path.GetFinalPathNameByHandle.cs │ │ ├── Path.GetFullPath.cs │ │ ├── Path.GetFullPathTransacted.cs │ │ ├── Path.GetInvalidFileNameChars.cs │ │ ├── Path.GetInvalidPathChars.cs │ │ ├── Path.GetLongFrom83ShortPath.cs │ │ ├── Path.GetLongFrom83ShortPathTransacted.cs │ │ ├── Path.GetLongPath.cs │ │ ├── Path.GetPathRoot.cs │ │ ├── Path.GetRandomFileName.cs │ │ ├── Path.GetRegularPath.cs │ │ ├── Path.GetRelativePath.cs │ │ ├── Path.GetShort83Path.cs │ │ ├── Path.GetShort83PathTransacted.cs │ │ ├── Path.GetSuffixedDirectoryName.cs │ │ ├── Path.GetSuffixedDirectoryNameTransacted.cs │ │ ├── Path.GetSuffixedDirectoryNameWithoutRoot.cs │ │ ├── Path.GetSuffixedDirectoryNameWithoutRootTransacted.cs │ │ ├── Path.GetTempFileName.cs │ │ ├── Path.GetTempPath.cs │ │ ├── Path.HasExtension.cs │ │ ├── Path.Helpers.cs │ │ ├── Path.IsLogicalDrive.cs │ │ ├── Path.IsLongPath.cs │ │ ├── Path.IsPathRooted.cs │ │ ├── Path.IsUncPath.cs │ │ ├── Path.IsValidName.cs │ │ ├── Path.LocalToUnc.cs │ │ ├── Path.RemoveTrailingDirectorySeparator.cs │ │ └── Path.cs │ ├── Shell32.cs │ ├── Shell32Info.cs │ └── Structures, Enumerations │ │ ├── CopyMoveProgressCallbackReason.cs │ │ ├── CopyMoveProgressResult.cs │ │ ├── CopyOptions.cs │ │ ├── DeviceGuid.cs │ │ ├── DiGetClassFlags.cs │ │ ├── DirectoryEnumerationFilters.cs │ │ ├── DirectoryEnumerationOptions.cs │ │ ├── DosDeviceAttributes.cs │ │ ├── EncryptedFileRawMode.cs │ │ ├── ErrorMode.cs │ │ ├── ExtendedFileAttributes.cs │ │ ├── FileEncryptionStatus.cs │ │ ├── FileIdInfo.cs │ │ ├── FinalPathFormats.cs │ │ ├── GetFullPathOptions.cs │ │ ├── MoveOptions.cs │ │ ├── PathFormat.cs │ │ ├── ReparsePointTag.cs │ │ ├── SetupDiGetDeviceRegistryPropertyEnum.cs │ │ ├── StreamAttribute.cs │ │ ├── StreamId.cs │ │ ├── SymbolicLinkTarget.cs │ │ └── SymbolicLinkType.cs │ ├── GlobalSuppressions.cs │ ├── NativeError.cs │ ├── Network │ ├── DfsInfo.cs │ ├── DfsStorageInfo.cs │ ├── Enumerations │ │ ├── AccessPermissions.cs │ │ ├── Connect.cs │ │ ├── ConnectivityStates.cs │ │ ├── DfsNamespaceFlavors.cs │ │ ├── DfsPropertyFlags.cs │ │ ├── DfsStorageStates.cs │ │ ├── DfsTargetPriorityClass.cs │ │ ├── DfsVolumeStates.cs │ │ ├── DomainType.cs │ │ ├── NetworkCategory.cs │ │ ├── NetworkConnectivityLevels.cs │ │ ├── ResourceDisplayType.cs │ │ ├── ResourceScope.cs │ │ ├── ResourceType.cs │ │ ├── ResourceUsage.cs │ │ ├── SessionInfoLevel.cs │ │ ├── ShareInfoLevel.cs │ │ ├── ShareResourceTypes.cs │ │ └── ShareType.cs │ ├── Host Class │ │ ├── Host.DFS.EnumerateDfsLinks.cs │ │ ├── Host.DFS.EnumerateDfsRoot.cs │ │ ├── Host.DFS.EnumerateDomainDfsRoot.cs │ │ ├── Host.DFS.GetDfsClientInfo.cs │ │ ├── Host.DFS.GetDfsInfo.cs │ │ ├── Host.EnumerateNetworkConnections.cs │ │ ├── Host.EnumerateNetworks.cs │ │ ├── Host.GetMappedConnectionName.cs │ │ ├── Host.GetMappedUncName.cs │ │ ├── Host.GetNetwork.cs │ │ ├── Host.GetNetworkConnection.cs │ │ ├── Host.GetUncName.cs │ │ ├── Host.SMB.EnumerateDrives.cs │ │ ├── Host.SMB.EnumerateOpenConnections.cs │ │ ├── Host.SMB.EnumerateOpenResources.cs │ │ ├── Host.SMB.EnumerateSessions.cs │ │ ├── Host.SMB.EnumerateShares.cs │ │ ├── Host.SMB.GetHostShareFromPath.cs │ │ ├── Host.SMB.GetNetStatistics.cs │ │ ├── Host.SMB.GetShareInfo.cs │ │ ├── Host.WNet.ConnectDrive.cs │ │ ├── Host.WNet.ConnectTo.cs │ │ ├── Host.WNet.DisconnectDrive.cs │ │ ├── Host.WNet.DisconnectFrom.cs │ │ ├── Host.WNet.DriveConnection.cs │ │ └── Host.cs │ ├── Native Methods │ │ ├── NativeMethods.DistributedFileSystem.cs │ │ ├── NativeMethods.INetwork.cs │ │ ├── NativeMethods.INetworkConnection.cs │ │ ├── NativeMethods.INetworkListManager.cs │ │ ├── NativeMethods.NetworkManagement.cs │ │ ├── NativeMethods.NetworkShareManagement.cs │ │ ├── NativeMethods.WindowsNetworking.cs │ │ └── NativeMethods.cs │ ├── Native Other │ │ ├── CONNECTION_INFO_1.cs │ │ ├── DFS_INFO_200.cs │ │ ├── DFS_INFO_300.cs │ │ ├── DFS_INFO_9.cs │ │ ├── DFS_STORAGE_INFO_1.cs │ │ ├── DFS_TARGET_PRIORITY.cs │ │ ├── FILE_INFO_3.cs │ │ ├── NETRESOURCE.cs │ │ ├── REMOTE_NAME_INFO.cs │ │ ├── SESSION_INFO_0.cs │ │ ├── SESSION_INFO_1.cs │ │ ├── SESSION_INFO_10.cs │ │ ├── SESSION_INFO_2.cs │ │ ├── SESSION_INFO_502.cs │ │ ├── SHARE_INFO_1.cs │ │ ├── SHARE_INFO_1005.cs │ │ ├── SHARE_INFO_2.cs │ │ ├── SHARE_INFO_502.cs │ │ ├── SHARE_INFO_503.cs │ │ ├── STAT_SERVER_0.cs │ │ └── STAT_WORKSTATION_0.cs │ ├── NetworkConnectionInfo.cs │ ├── NetworkInfo.cs │ ├── NetworkListManager.cs │ ├── OpenConnectionInfo.cs │ ├── OpenResourceInfo.cs │ ├── ServerStatisticsInfo.cs │ ├── SessionInfo.cs │ ├── ShareInfo.cs │ └── WorkstationStatisticsInfo.cs │ ├── OperatingSystem.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Safe Handles │ ├── SafeCmConnectMachineHandle.cs │ ├── SafeEncryptedFileRawHandle.cs │ ├── SafeFindFileHandle.cs │ ├── SafeFindVolumeHandle.cs │ ├── SafeFindVolumeMountPointHandle.cs │ ├── SafeGlobalMemoryBufferHandle.cs │ ├── SafeKernelTransactionHandle.cs │ ├── SafeLocalMemoryBufferHandle.cs │ ├── SafeNativeMemoryBufferHandle.cs │ ├── SafeSetupDiClassDevsExHandle.cs │ └── SafeTokenHandle.cs │ ├── Security │ ├── CRC │ │ ├── Crc32.cs │ │ ├── Crc64.cs │ │ └── HashType.cs │ ├── InternalPrivilegeEnabler.cs │ ├── Native Methods │ │ ├── NativeMethods.AdjustTokenPrivileges.cs │ │ ├── NativeMethods.Constants.cs │ │ ├── NativeMethods.GetNamedSecurityInfo.cs │ │ ├── NativeMethods.GetSecurityDescriptorControl.cs │ │ ├── NativeMethods.GetSecurityDescriptorDacl.cs │ │ ├── NativeMethods.GetSecurityDescriptorGroup.cs │ │ ├── NativeMethods.GetSecurityDescriptorLength.cs │ │ ├── NativeMethods.GetSecurityDescriptorOwner.cs │ │ ├── NativeMethods.GetSecurityDescriptorSacl.cs │ │ ├── NativeMethods.GetSecurityInfo.cs │ │ ├── NativeMethods.GetTokenInformation.cs │ │ ├── NativeMethods.LocalFree.cs │ │ ├── NativeMethods.LookupPrivilegeDisplayName.cs │ │ ├── NativeMethods.LookupPrivilegeValue.cs │ │ ├── NativeMethods.OpenProcessToken.cs │ │ ├── NativeMethods.SetNamedSecurityInfo.cs │ │ └── NativeMethods.SetSecurityInfo.cs │ ├── Native Other │ │ ├── Luid.cs │ │ ├── SECURITY_DESCRIPTOR_CONTROL.cs │ │ ├── SECURITY_INFORMATION.cs │ │ ├── SE_OBJECT_TYPE.cs │ │ ├── TOKEN.cs │ │ ├── TOKEN_ELEVATION_TYPE.cs │ │ ├── TOKEN_INFORMATION_CLASS.cs │ │ └── TOKEN_PRIVILEGES.cs │ ├── Privilege.cs │ ├── PrivilegeEnabler.cs │ ├── ProcessContext.cs │ └── SecurityAttributes.cs │ ├── Utils.cs │ ├── Win32Errors.cs │ ├── app.config │ └── packages.config └── tests └── AlphaFS.UnitTest ├── AlphaFS BackupFileStream Class ├── AlphaFS_AlphaFS_BackupFileStream_FilePortionIsLocked_ThrowsIOException.cs ├── AlphaFS_BackupFileStreamTest.cs ├── AlphaFS_BackupFileStream_InitializeInstance.cs └── AlphaFS_BackupFileStream_SegmentAlreadyUnlocked_ThrowsIOException.cs ├── AlphaFS ByHandleFileInfo Class ├── AlphaFS_ByHandleFileInfoTest.cs ├── AlphaFS_Directory.GetFileInfo.cs └── AlphaFS_File.GetFileInfoByHandle.cs ├── AlphaFS CRC Class ├── AlphaFS_Crc32_StaticDefaultSeedAndPolynomialWithShortAsciiString.cs ├── AlphaFS_Crc32_StaticDefaultSeedAndPolynomialWithShortAsciiString2.cs ├── AlphaFS_Crc64Iso_StaticDefaultSeedAndPolynomialWithShortAsciiString.cs ├── AlphaFS_Crc64Iso_StaticDefaultSeedAndPolynomialWithShortAsciiString2.cs └── AlphaFS_CrcTest.cs ├── AlphaFS Compression ├── AlphaFS CompressionTest.cs ├── AlphaFS_Directory.Compress_And_Decompress.cs ├── AlphaFS_Directory.Compress_And_Decompress_Recursive.cs └── AlphaFS_File.Compress_And_Decompress.cs ├── AlphaFS Device Class ├── AlphaFS Volume Class │ ├── AlphaFS_Volume.DefineDosDevice_RegularDriveMapping.cs │ ├── AlphaFS_Volume.DefineDosDevice_SymbolicLinkDriveMapping.cs │ ├── AlphaFS_Volume.EnumerateVolumeMountPoints.cs │ ├── AlphaFS_Volume.EnumerateVolumes.cs │ ├── AlphaFS_Volume.GetDriveFormat.cs │ ├── AlphaFS_Volume.GetDriveNameForNtDeviceName.cs │ ├── AlphaFS_Volume.GetDriveType.cs │ ├── AlphaFS_Volume.GetUniqueVolumeNameForPath.cs │ ├── AlphaFS_Volume.GetVolumeInfo.cs │ ├── AlphaFS_Volume.GetVolumeLabel.cs │ ├── AlphaFS_Volume.GetXxx.cs │ ├── AlphaFS_Volume.IsSameVolume.cs │ ├── AlphaFS_Volume.QueryDosDevice.cs │ ├── AlphaFS_Volume.SetVolumeLabel.cs │ ├── AlphaFS_Volume.SetVolumeMountPoint.cs │ └── AlphaFS_VolumeTest.cs ├── AlphaFS_Device.EnumerateDevices.cs └── DriveInfo Class │ ├── DriveInfo.GetDrives.cs │ ├── DriveInfo.InitializeInstance.cs │ └── DriveInfoTest.cs ├── AlphaFS Encryption ├── AlphaFS_Directory.ExportImportEncryptedDirectoryRaw.cs ├── AlphaFS_Directory_EnableEncryption_And_DisableEncryption.cs ├── AlphaFS_Directory_Encrypt_And_Decrypt.cs ├── AlphaFS_Directory_Encrypt_And_Decrypt_Recursive.cs ├── AlphaFS_EncryptionTest.cs ├── AlphaFS_File.ExportImportEncryptedFileRaw.cs ├── AlphaFS_File.GetHash.cs └── AlphaFS_File_EncryptDecrypt_GetEncryptionStatus.cs ├── AlphaFS FileIdInfo Class ├── AlphaFS_Directory.GetFileIdInfo.cs ├── AlphaFS_File.GetFileIdInfo.cs └── AlphaFS_FileIdInfoTest.cs ├── AlphaFS FileSystemEntryInfo Class ├── AlphaFS_Directory.AlphaFS_Directory_GetFileSystemEntryInfo_FileExistsWithSameNameAsDirectory_ThrowsDirectoryNotFoundException.cs ├── AlphaFS_Directory.EnumerateFileSystemEntryInfos_ContinueOnAccessDeniedExceptionUsingDirectoryEnumerationErrorFilter.cs ├── AlphaFS_Directory.EnumerateFileSystemEntryInfos_EnumerateFiles_UsingDirectoryEnumerationFilters.cs ├── AlphaFS_Directory.EnumerateFileSystemEntryInfos_FolderWithSpaceAsName.cs ├── AlphaFS_Directory.EnumerateFileSystemEntryInfos_TypeDirectoryInfo.cs ├── AlphaFS_Directory.EnumerateFileSystemEntryInfos_TypeFileInfo.cs ├── AlphaFS_Directory.EnumerateFileSystemEntryInfos_TypeFileSystemEntryInfo.cs ├── AlphaFS_Directory.EnumerateFileSystemEntryInfos_TypeString.cs ├── AlphaFS_Directory.GetFileSystemEntryInfo.cs ├── AlphaFS_Directory.GetFileSystemEntryInfo_LogicalDrives.cs ├── AlphaFS_File.GetFileSystemEntryInfo.cs ├── AlphaFS_File.GetFileSystemEntryInfo_DirectoryExistsWithSameNameAsFile_ThrowsFileNotFoundException.cs └── AlphaFS_FileSystemEntryInfoTest.cs ├── AlphaFS Host Class ├── AlphaFS_Host.ConnectDrive_And_DisconnectDrive.cs ├── AlphaFS_Host.ConnectTo_Ipc_And_DisconnectFrom_Ipc.cs ├── AlphaFS_Host.ConnectTo_Share_And_DisconnectFrom_Share.cs ├── AlphaFS_Host.DriveConnection.cs ├── AlphaFS_Host.EnumerateDfsLinks.cs ├── AlphaFS_Host.EnumerateDfsRoot.cs ├── AlphaFS_Host.EnumerateDomainDfsRoot.cs ├── AlphaFS_Host.EnumerateDrives.cs ├── AlphaFS_Host.EnumerateNetworkConnections.cs ├── AlphaFS_Host.EnumerateNetworks.cs ├── AlphaFS_Host.EnumerateOpenConnections.cs ├── AlphaFS_Host.EnumerateOpenResources.cs ├── AlphaFS_Host.EnumerateSessions.cs ├── AlphaFS_Host.EnumerateShares.cs ├── AlphaFS_Host.GetHostShareFromPath.cs ├── AlphaFS_Host.GetMappedConnectionName.cs ├── AlphaFS_Host.GetMappedUncName.cs ├── AlphaFS_Host.GetServerStatistics.cs ├── AlphaFS_Host.GetUncName.cs ├── AlphaFS_Host.GetWorkstationStatistics.cs └── AlphaFS_HostTest.cs ├── AlphaFS Junctions, Links ├── AlphaFS_Directory.Copy_SymbolicLink_SourceIsASymbolicLink_TargetMustAlsoBeASymbolicLink.cs ├── AlphaFS_Directory.CreateJunction_DirectoryContainsFile_ThrowsDirectoryNotEmptyException.cs ├── AlphaFS_Directory.CreateJunction_FileExistsWithSameNameAsDirectory_ThrowsIOException.cs ├── AlphaFS_Directory.CreateJunction_FromMappedDrive_ThrowsArgumentException.cs ├── AlphaFS_Directory.CreateJunction_FromUncPath_ThrowsArgumentException.cs ├── AlphaFS_Directory.CreateSymbolicLink_And_GetLinkTargetInfo.cs ├── AlphaFS_Directory.CreateSymbolicLink_FileExistsWithSameNameAsDirectory_ThrowsIOException.cs ├── AlphaFS_DirectoryInfo.CreateJunction_And_ExistsJunction_And_DeleteJunction.cs ├── AlphaFS_File.Copy_SymbolicLink_SourceIsASymbolicLink_TargetMustAlsoBeASymbolicLink.cs ├── AlphaFS_File.CreateHardlink_And_EnumerateHardlinks.cs ├── AlphaFS_File.CreateSymbolicLink_And_GetLinkTargetInfo.cs ├── AlphaFS_File.CreateSymbolicLink_DirectoryExistsWithSameNameAsFile_ThrowsIOException.cs └── AlphaFS_JunctionsLinksTest.cs ├── AlphaFS Shell32 Class ├── AlphaFS_Shell32.GetFileAssociation.cs ├── AlphaFS_Shell32.GetFileIcon.cs ├── AlphaFS_Shell32.GetVerbCommand.cs ├── AlphaFS_Shell32Info.InitializeInstance.cs ├── AlphaFS_Shell32Test..cs ├── AlphaFS_Shell32Test.PathCreateFromUrl.cs ├── AlphaFS_Shell32Test.PathCreateFromUrlAlloc.cs ├── AlphaFS_Shell32Test.PathFileExists.cs └── AlphaFS_Shell32Test.UrlIs.cs ├── AlphaFS Utils Class ├── AlphaFS_Utils.ReplaceIgnoreCase.cs └── AlphaFS_UtilsTest.cs ├── AlphaFS.UnitTest.csproj ├── Directory Class ├── AlphaFS_Directory.Copy │ ├── AlphaFS_Directory.Copy.cs │ ├── AlphaFS_Directory.Copy_3ExistingDirectories_FromVolumeShadowCopy.cs │ ├── AlphaFS_Directory.Copy_DestinationFileAlreadyExists_ThrowsAlreadyExistsException.cs │ ├── AlphaFS_Directory.Copy_NoRetry_ThrowsUnauthorizedAccessException.cs │ ├── AlphaFS_Directory.Copy_NonExistingDestinationLogicalDrive_ThrowsDeviceNotReadyException.cs │ ├── AlphaFS_Directory.Copy_NonExistingSourceDirectory_ThrowsDirectoryNotFoundException.cs │ ├── AlphaFS_Directory.Copy_NonExistingSourceLogicalDrive_ThrowsDeviceNotReadyException.cs │ ├── AlphaFS_Directory.Copy_Overwrite_DestinationFileAlreadyExists.cs │ ├── AlphaFS_Directory.Copy_RetryFails1Time_ThenSucceeds.cs │ ├── AlphaFS_Directory.Copy_RetryFails2Times_ThrowsUnauthorizedAccessException.cs │ ├── AlphaFS_Directory.Copy_UserExplicitDenyOnDestinationFolder_ThrowsUnauthorizedAccessException.cs │ └── AlphaFS_Directory.Copy_WithProgress.cs ├── AlphaFS_Directory.CountFileSystemObjects │ ├── AlphaFS_Directory.CountFileSystemObjectsTest.cs │ ├── AlphaFS_Directory.CountFileSystemObjects_FilesOnly_NonRecursive.cs │ ├── AlphaFS_Directory.CountFileSystemObjects_FilesOnly_Recursive.cs │ ├── AlphaFS_Directory.CountFileSystemObjects_FoldersAndFiles_Recursive.cs │ ├── AlphaFS_Directory.CountFileSystemObjects_FoldersOnly_NonRecursive.cs │ └── AlphaFS_Directory.CountFileSystemObjects_FoldersOnly_Recursive.cs ├── AlphaFS_Directory.DeleteEmptySubdirectories │ ├── AlphaFS_Directory.DeleteEmptySubdirectories.cs │ ├── AlphaFS_Directory.DeleteEmptySubdirectoriesTest.cs │ ├── AlphaFS_Directory.DeleteEmptySubdirectories_DirectoryContainsAFile_DirectoryRemains.cs │ └── AlphaFS_Directory.DeleteEmptySubdirectories_DirectoryContainsAFolder_DirectoryRemains.cs ├── AlphaFS_Directory.GetSize │ ├── AlphaFS_Directory.GetSize_NoStreamsOnRootFolder.cs │ └── AlphaFS_Directory.GetSize_WithStreamsOnRootFolder.cs ├── AlphaFS_Directory.IsEmpty │ ├── AlphaFS_Directory.IsEmpty.cs │ ├── AlphaFS_Directory.IsEmptyTest.cs │ ├── AlphaFS_Directory.IsEmpty_DirectoryContainsAFile_IsFalse.cs │ └── AlphaFS_Directory.IsEmpty_DirectoryContainsAFolder_IsFalse.cs ├── Directory.CreateDirectory │ ├── AlphaFS_Directory.CreateDirectory_And_Delete_UsingMSDOSReservedNames.cs │ ├── AlphaFS_Directory.CreateDirectory_FileExistsWithSameNameAsDirectory_ThrowsAlreadyExistsException.cs │ ├── AlphaFS_Directory.CreateDirectory_NonExistingDriveLetter_ThrowsIOExceptionOrDeviceNotReadyException.cs │ ├── Directory.CreateDirectoryTest.cs │ ├── Directory.CreateDirectory_And_Delete_CreatesStructureWithoutFiles.cs │ ├── Directory.CreateDirectory_EmptyAsPath_ThrowsArgumentException.cs │ ├── Directory.CreateDirectory_FolderWithSpaceAsName.cs │ ├── Directory.CreateDirectory_NonExistingDriveLetter_ThrowsDirectoryNotFoundException.cs │ ├── Directory.CreateDirectory_NullAsPath_ThrowsArgumentNullException.cs │ ├── Directory.CreateDirectory_WithDirectorySecurity.cs │ └── Directory.CreateDirectory_WithMultipleSpacesAndSlashes.cs ├── Directory.CurrentDirectory │ ├── Directory.CurrentDirectoryTest.cs │ ├── Directory.GetCurrentDirectory.cs │ ├── Directory.SetCurrentDirectory.cs │ └── Directory.SetCurrentDirectory_WithLongPath.cs ├── Directory.Delete │ ├── AlphaFS_Directory.Delete_NonEmptyDirectory_ThrowsDirectoryNotEmptyException.cs │ ├── AlphaFS_Directory.Delete_NonExistingLogicalDrive_ThrowsDeviceNotReadyException.cs │ ├── AlphaFS_Directory.Delete_ThrowDirectoryReadOnlyException_DirectoryIsReadOnly.cs │ ├── Directory.Delete.DirectoryIsReadOnly_ThrowsDirectoryReadOnlyException.cs │ ├── Directory.Delete_EmptyAsPath_ThrowsArgumentException.cs │ ├── Directory.Delete_ExistingDirectory.cs │ ├── Directory.Delete_NonExistingDirectory_ThrowsDirectoryNotFoundException.cs │ ├── Directory.Delete_NullAsPath_ThrowsArgumentNullException.cs │ └── Directory.Directory_Delete_DirectoryHasDenyPermission_ThrowsUnauthorizedAccessException.cs ├── Directory.Exists │ ├── AlphaFS_Directory.Exists_WithLeadingOrTrailingSpace.cs │ ├── Directory.Exists_DriveLetter.cs │ ├── Directory.Exists_ExistingDirectory.cs │ ├── Directory.Exists_NonExistingDirectory.cs │ └── Directory.Exists_UseCases.cs ├── Directory.GetDirectories │ ├── Directory.GetDirectories_AbsolutePath.cs │ ├── Directory.GetDirectories_RelativePath.cs │ └── Directory.GetDirectories_WithSearchPattern.cs ├── Directory.GetDirectoryRoot.cs ├── Directory.GetFileSystemEntries.cs ├── Directory.GetFiles │ ├── Directory.GetFiles_AbsolutePath.cs │ ├── Directory.GetFiles_RelativePath.cs │ └── Directory.GetFiles_WithSearchPattern.cs ├── Directory.GetLogicalDrives.cs ├── Directory.GetParent.cs ├── Directory.GetProperties.cs ├── Directory.Move │ ├── AlphaFS_Directory.Move_DestinationDirectoryAlreadyExists_ThrowsAlreadyExistsException.cs │ ├── AlphaFS_Directory.Move_FileToMappedDriveLetter.cs │ ├── AlphaFS_Directory.Move_NonExistingDestinationLogicalDrive_ThrowsDeviceNotReadyException.cs │ ├── AlphaFS_Directory.Move_NonExistingSourceLogicalDrive_ThrowsDeviceNotReadyException.cs │ ├── AlphaFS_Directory.Move_Overwrite_DestinationDirectoryAlreadyExists.cs │ ├── AlphaFS_Directory.Move_ToDifferentVolume_EmulateMoveUsingCopyDelete.cs │ ├── Directory.Move_NonExistingSourceDirectory_ThrowsDirectoryNotFoundException.cs │ ├── Directory.Move_Rename.cs │ ├── Directory.Move_Rename_DifferentCasingDirectory.cs │ ├── Directory.Move_SameSourceAndDestination_ThrowsIOException.cs │ ├── Directory.Move_SameVolume.cs │ └── Directory.Move_UserExplicitDenyOnDestinationFolder_ThrowsUnauthorizedAccessException.cs ├── DirectoryTest.cs ├── Directory_AccessControl │ ├── AlphaFS_Directory.HasInheritedPermissions.cs │ ├── Directory.GetAccessControl.cs │ └── Directory.SetAccessControl.cs ├── Directory_Enumeration │ ├── AlphaFS_Directory.EnumerateAlternateDataStreams.cs │ ├── AlphaFS_Directory.EnumerateFileIdBothDirectoryInfo.cs │ ├── Directory.EnumerateDirectories.cs │ ├── Directory.EnumerateFileSystemEntries.cs │ └── Directory.EnumerateFiles.cs ├── Directory_GetFileSystemEntries_LongPathPrefix_ShouldReturnCorrectEntries.cs └── Directory_Timestamps │ ├── AlphaFS_Directory.CopyTimestamps.cs │ ├── AlphaFS_Directory.Copy_UsingCopyOptionsCopyTimestampFlag.cs │ ├── AlphaFS_Directory.GetChangeTime.cs │ ├── AlphaFS_Directory.SetTimestamps.cs │ ├── AlphaFS_Directory.SetTimestamps_SymbolicLink.cs │ └── Directory_Timestamps_CompareTimestamps_NonExistingDirectory.cs ├── DirectoryInfo Class ├── DirectoryInfo.Attributes.cs ├── DirectoryInfo.FolderName255Characters.cs ├── DirectoryInfo.InitializeInstance │ ├── DirectoryInfo.InitializeInstance_AnalyzeDirectoryInfoSecurity.cs │ ├── DirectoryInfo.InitializeInstance_ExistingDirectory.cs │ ├── DirectoryInfo.InitializeInstance_ExistingFileAsDirectoryeName_PropertyExistsShouldbeFalse.cs │ ├── DirectoryInfo.InitializeInstance_FolderNameGreaterThan255Characters_ThrowsPathTooLongException.cs │ └── DirectoryInfo.InitializeInstance_NonExistingDirectory.cs ├── DirectoryInfo.MoveTo │ ├── AlphaFS_DirectoryInfo.MoveTo_DelayUntilReboot.cs │ ├── AlphaFS_DirectoryInfo.MoveTo_DelayUntilRebootFlagCombinedWithCopyAllowedFlagUsingUncPath_ThrowsArgumentException.cs │ ├── DirectoryInfo.MoveTo_FolderToEmptyFolder.cs │ └── DirectoryInfo.MoveTo_Rename.cs ├── DirectoryInfo.Refresh.cs └── DirectoryInfoTest.cs ├── File Class ├── AlphaFS_File.EnumerateAlternateDataStreams.cs ├── AlphaFS_File_GetSize │ ├── AlphaFS_File.GetCompressedSize.cs │ ├── AlphaFS_File.GetSize_AllStreams.cs │ └── AlphaFS_File.GetSize_Stream0.cs ├── AlphaFS_File_Lock │ ├── AlphaFS_File.GetProcessForFileLock.cs │ ├── AlphaFS_File.GetProcessForFileLock_NoLockReturnsNull.cs │ ├── AlphaFS_File.IsLocked.cs │ └── AlphaFS_File.LockTest.cs ├── File.Copy │ ├── AlphaFS_File.Copy_3ExistingFiles_FromVolumeShadowCopy.cs │ ├── AlphaFS_File.Copy_DestinationFileAlreadyExists_ThrowsAlreadyExistsException.cs │ ├── AlphaFS_File.Copy_NonExistingDestinationLogicalDrive_ThrowsDeviceNotReadyException.cs │ ├── AlphaFS_File.Copy_NonExistingSourceLogicalDrive_ThrowsDeviceNotReadyException.cs │ ├── AlphaFS_File.Copy_Overwrite_DestinationFileAlreadyExists.cs │ ├── AlphaFS_File.Copy_RetryFails2Times_ThrowsUnauthorizedAccessException.cs │ ├── AlphaFS_File.Copy_WithProgress.cs │ ├── File.Copy.cs │ ├── File.Copy_DestinationFileIsReadOnly_ThrowsUnauthorizedAccessException.cs │ ├── File.Copy_EmptyDestFileNameAsPath_ThrowsArgumentException.cs │ ├── File.Copy_EmptySourceFileNameAsPath_ThrowsArgumentException.cs │ ├── File.Copy_NonExistingSourceDirectory_ThrowsDirectoryNotFoundException.cs │ ├── File.Copy_NonExistingSourceFile_ThrowsFileNotFoundException.cs │ ├── File.Copy_NullDestFileNameAsPath_ThrowsArgumentNullException.cs │ └── File.Copy_NullSourceFileNameAsPath_ThrowsArgumentNullException.cs ├── File.Delete │ ├── AlphaFS_File.Delete_FileIsReadOnly_ThrowsFileReadOnlyException.cs │ ├── File.Delete_EmptyAsPath_ThrowsArgumentException.cs │ ├── File.Delete_ExistingFile.cs │ ├── File.Delete_NonExistingDriveLetter_ThrowsDirectoryNotFoundException.cs │ ├── File.Delete_NonExistingDriveLetter_ThrowsIOExceptionOrDeviceNotReadyException.cs │ ├── File.Delete_NonExistingFile_NoException.cs │ ├── File.Delete_NullAsPath_ThrowsArgumentNullException.cs │ └── File.Delete_PathIsADirectoryNotAFile_ThrowsUnauthorizedAccessException.cs ├── File.Exists │ ├── AlphaFS_File.Exists_WithLeadingOrTrailingSpace.cs │ └── File.Exists_ExistingFile.cs ├── File.Move │ ├── AlphaFS_File.Move_DestinationFileAlreadyExists_ThrowsAlreadyExistsException.cs │ ├── AlphaFS_File.Move_NonExistingDestinationLogicalDrive_ThrowsDeviceNotReadyException.cs │ ├── AlphaFS_File.Move_NonExistingSourceLogicalDrive_ThrowsDeviceNotReadyException.cs │ ├── AlphaFS_File.Move_Overwrite_DestinationFileAlreadyExists.cs │ ├── File.Move_EmptyDestFileNameAsPath_ThrowsArgumentException.cs │ ├── File.Move_EmptySourceFileNameAsPath_ThrowsArgumentException.cs │ ├── File.Move_ExistingFile.cs │ ├── File.Move_FileOpenedWithFileShareDeleteFlag.cs │ ├── File.Move_NonExistingSourceDirectory_ThrowsDirectoryNotFoundException.cs │ ├── File.Move_NonExistingSourceFile_ThrowsFileNotFoundException.cs │ ├── File.Move_NullDestFileNameAsPath_ThrowsArgumentNullException.cs │ └── File.Move_NullSourceFileNameAsPath_ThrowsArgumentNullException.cs ├── File.Open │ ├── File.OpenRead.cs │ ├── File.OpenRead_OpenReadTwiceShouldNotLock.cs │ ├── File.OpenText.cs │ ├── File.OpenWrite.cs │ ├── File_Open_Append.cs │ ├── File_Open_Append_NoObjectDisposedException.cs │ ├── File_Open_Create.cs │ └── File_Open_OverlappedIO.cs ├── File.Replace │ ├── File.Replace.cs │ └── File.Replace_NoBackup.cs ├── FileTest.cs ├── File_AccessControl │ ├── File.GetAccessControl.cs │ └── File.SetAccessControl.cs ├── File_Append │ ├── File.AppendAllLines_ThenReadAllLinesShouldReturnSameCollection.cs │ ├── File.AppendAllText_ThenReadAllLinesShouldReturnSameCollection.cs │ ├── File.AppendTest.cs │ └── File.AppendText_ThenReadAllLinesShouldReturnSameCollection.cs ├── File_Attributes │ ├── File.GetAttributes.cs │ └── File.SetAttributes.cs ├── File_Create │ ├── File.Create.cs │ ├── File.CreateTest.cs │ ├── File.CreateText.cs │ ├── File.CreateText_ThenReadAllLinesShouldReturnSameCollection.cs │ └── File.Create_WithFileSecurity.cs ├── File_Read │ ├── File.ReadAllBytes.cs │ ├── File.ReadAllLines.cs │ ├── File.ReadAllText.cs │ └── File.ReadLines.cs ├── File_Timestamps │ ├── AlphaFS_File.CopyTimestamps.cs │ ├── AlphaFS_File.GetChangeTime.cs │ ├── AlphaFS_File.SetTimestamps.cs │ └── File_Timestamps_CompareTimestamps_NonExistingFile.cs └── File_Write │ ├── File.WriteAllBytes.cs │ ├── File.WriteAllLines.cs │ └── File.WriteAllText.cs ├── FileInfo Class ├── FileInfo.Attributes.cs ├── FileInfo.InitializeInstance │ ├── FileInfo.InitializeInstance_ExistingDirectoryAsFileName_PropertyExistsShouldbeFalse.cs │ ├── FileInfo.InitializeInstance_ExistingFile.cs │ └── FileInfo.InitializeInstance_NonExistingFile.cs ├── FileInfo.Refresh.cs └── FileInfoTest.cs ├── Path Class ├── AlphaFS_Path.CheckSupportedPathFormat │ ├── AlphaFS_Path.CheckSupportedPathFormat_PathContainsColon_ThrowsNotSupportedException.cs │ ├── AlphaFS_Path.CheckSupportedPathFormat_PathContainsInvalidCharacters_ThrowsArgumentException.cs │ └── AlphaFS_Path.CheckSupportedPathFormat_PathStartsWithColon.cs ├── AlphaFS_Path.GetFinalPathNameByHandle │ ├── AlphaFS_Path.GetFinalPathNameByHandle.cs │ └── AlphaFS_Path.GetFinalPathNameByHandle_ToGetFileStreamName.cs ├── AlphaFS_Path.GetLongPath.cs ├── AlphaFS_Path.GetRegularPath.cs ├── AlphaFS_Path.GetRelativePathResolveRelativePath.cs ├── AlphaFS_Path.GetShort83PathAndGetLongFrom83ShortPath_FromFile.cs ├── AlphaFS_Path.IsLongPath.cs ├── AlphaFS_Path.LocalToUnc.cs ├── AlphaFS_Path_IsUncPath.cs ├── AlphaFS_Path_TrailingDirectorySeparator.cs ├── Path.Combine.cs ├── Path.GetDirectoryName │ ├── AlphaFS_Path.GetDirectoryNameWithoutRoot.cs │ ├── AlphaFS_Path.GetSuffixedDirectoryName.cs │ ├── AlphaFS_Path.GetSuffixedDirectoryNameWithoutRoot.cs │ └── Path.GetDirectoryName.cs ├── Path.GetExtension │ ├── Path.GetExtension.cs │ └── Path.GetExtension_NullOrEmpty.cs ├── Path.GetFileName │ ├── Path.GetFileName.cs │ └── Path.GetFileName_NullOrEmpty.cs ├── Path.GetFileNameWithoutExtension │ ├── Path.GetFileNameWithoutExtension.cs │ └── Path.GetFileNameWithoutExtension_NullOrEmpty.cs ├── Path.GetFullPath │ ├── AlphaFS_Path.GetFullPath_WithTrailingDotOrSpace.cs │ ├── Path.GetFullPath.cs │ ├── Path.GetFullPath_InvalidLocalPath1_ThrowsArgumentException_Success.cs │ ├── Path.GetFullPath_InvalidLocalPath2_ThrowsArgumentException.cs │ └── Path.GetFullPath_InvalidPath_ThrowsNotSupportedException.cs ├── Path.GetPathRoot │ ├── Path.GetPathRoot.cs │ └── Path.GetPathRoot_ThrowArgumentExceptionEmptyString.cs ├── Path.IsPathRooted │ ├── Path.IsPathRooted.cs │ └── Path.IsPathRooted_NullOrEmpty.cs └── PathTest.cs ├── Properties └── AssemblyInfo.cs ├── UnitTest Utility ├── DirectoryAssert.cs ├── Dump.cs ├── FileAssert.cs ├── PrintUnitTestHeader.cs ├── StringToByteArray.cs ├── TemporaryDirectory.cs ├── TestAccessRules.cs ├── UnitTestAssert.cs └── UnitTestConstants.cs └── UnitTests ├── AccessControlTest.cs ├── AlphaFS_DfsInfoTest.cs ├── AlphaFS_OperatingSystemTest.cs ├── AlphaFS_ProcessContextTest.cs ├── CopyTest.cs ├── DeleteTest.cs ├── EnumerationTest.cs ├── ExistsTest.cs ├── MoveTest.cs ├── SizeTest.cs └── TimestampsTest.cs /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 3 9 | end_of_line = crlf 10 | insert_final_newline = true 11 | charset = utf-8 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | # http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ 3 | * text=auto 4 | # Custom for Visual Studio 5 | *.sln text eol=crlf merge=union 6 | *.csproj merge=union 7 | *.vbproj merge=union 8 | *.fsproj merge=union 9 | *.dbproj merge=union 10 | 11 | # CSharp 12 | *.cs diff=csharp 13 | 14 | #common settings that generally should always be used with your language specific settings 15 | # Auto detect text files and perform LF normalization 16 | # http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ 17 | * text=auto 18 | # 19 | # The above will handle all files NOT found below 20 | # 21 | # Documents 22 | *.doc diff=astextplain 23 | *.DOC diff=astextplain 24 | *.docx diff=astextplain 25 | *.DOCX diff=astextplain 26 | *.dot diff=astextplain 27 | *.DOT diff=astextplain 28 | *.pdf diff=astextplain 29 | *.PDF diff=astextplain 30 | *.rtf diff=astextplain 31 | *.RTF diff=astextplain 32 | *.md text 33 | *.adoc text 34 | *.textile text 35 | *.mustache text 36 | *.csv text 37 | *.tab text 38 | *.tsv text 39 | *.sql text 40 | # Graphics 41 | *.png binary 42 | *.jpg binary 43 | *.jpeg binary 44 | *.gif binary 45 | *.ico binary 46 | *.svg text -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright (c) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 7 | software and associated documentation files (the "Software"), to deal in the Software 8 | without restriction, including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to 10 | whom the Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or 13 | substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 16 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /appveyor.deploy-docs.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2017 2 | configuration: Release 3 | 4 | install: 5 | - ps: $fileContent = "-----BEGIN RSA PRIVATE KEY-----`n" 6 | - ps: $fileContent += $env:deploy_key.Replace(' ', "`n") 7 | - ps: $fileContent += "`n-----END RSA PRIVATE KEY-----`n" 8 | - ps: Set-Content $env:userprofile\.ssh\id_rsa $fileContent 9 | 10 | branches: 11 | only: 12 | - never-build-branch-automatically-dont-use-this-name 13 | 14 | pull_requests: 15 | do_not_increment_build_number: true 16 | 17 | os: Visual Studio 2017 18 | 19 | build_script: 20 | - ps: .\build.ps1 -target DocPublish -verbosity verbose 21 | 22 | test: off 23 | deploy: off 24 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2017 2 | configuration: Release 3 | 4 | environment: 5 | semVersion: 2.3.0 6 | 7 | branches: 8 | except: 9 | - gh-pages 10 | - gh-pages-lab 11 | 12 | pull_requests: 13 | do_not_increment_build_number: true 14 | 15 | os: Visual Studio 2017 16 | 17 | build_script: 18 | - ps: .\build.ps1 19 | 20 | test: off 21 | deploy: off 22 | 23 | artifacts: 24 | - path: 'artifacts/**/*.nupkg' 25 | - path: 'artifacts/docs' 26 | -------------------------------------------------------------------------------- /build/AlphaFS.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alphaleonis/AlphaFS/7abc4ed0179ec01e0e1cd32d87ccde8a4cf3297c/build/AlphaFS.snk -------------------------------------------------------------------------------- /build/appveyor-util.cake: -------------------------------------------------------------------------------- 1 | #l "rest-util.cake" 2 | void DownloadAppVeyorArtifact(string apiUrl, string jobId, string artifactName, string sourceBuildVersion, FilePath targetFile) 3 | { 4 | var artifacts = RestInvoke>(apiUrl, $"buildjobs/{jobId}/artifacts", Method.GET); 5 | 6 | ArtifactInfo matchingArtifact = null; 7 | foreach (var artifact in artifacts) 8 | { 9 | Verbose($"- Found artifact: {artifact.FileName} of type {artifact.Type}"); 10 | if (artifact.FileName.Equals(artifactName, StringComparison.OrdinalIgnoreCase)) { 11 | if (matchingArtifact != null) 12 | throw new Exception($"Multiple artifacts matching the name \"{artifactName}\" were found."); 13 | else 14 | matchingArtifact = artifact; 15 | } 16 | } 17 | 18 | if (matchingArtifact == null) 19 | throw new FileNotFoundException($"Unable to find artifact named \"{artifactName}\" in build {sourceBuildVersion}."); 20 | 21 | Information($"Found matching artifact: {matchingArtifact.FileName}, type={matchingArtifact.Type}, size={matchingArtifact.Size}b"); 22 | 23 | var url = apiUrl + $"/buildjobs/{jobId}/artifacts/{WebUtility.UrlEncode(matchingArtifact.FileName)}"; 24 | Information($"Downloading artifact {matchingArtifact.FileName} to {targetFile.FullPath}"); 25 | DownloadFile(url, targetFile); 26 | } 27 | 28 | void PublishAppVeyorTestResult(FilePath trxFile, string appVeyorApiBaseUrl = "https://ci.appveyor.com/api") 29 | { 30 | if (BuildSystem.IsRunningOnAppVeyor) 31 | { 32 | UploadFile($"{appVeyorApiBaseUrl}/testresults/mstest/{BuildSystem.AppVeyor.Environment.JobId}", trxFile); 33 | } 34 | } 35 | class ArtifactInfo 36 | { 37 | public string FileName { get; set; } 38 | public string Type { get; set; } 39 | public long Size{ get; set;} 40 | public DateTime Created { get; set; } 41 | public string RelativeName => System.IO.Path.GetFileName(FileName); 42 | } -------------------------------------------------------------------------------- /build/common.cake: -------------------------------------------------------------------------------- 1 | /// 2 | /// Deletes the specified directory if it exists. 3 | /// 4 | /// The directory to delete. 5 | void DeleteDirectoryIfExists(DirectoryPath path, bool force = true) 6 | { 7 | if (DirectoryExists(path)) 8 | { 9 | DeleteDirectory(path, new DeleteDirectorySettings { Force = force, Recursive = true }); 10 | } 11 | } 12 | 13 | /// 14 | /// Deletes all contents of the specified directory, optionally also removing read-only files. 15 | /// 16 | /// The directory to delete all contents of. 17 | /// If true even read-only files will be deleted. 18 | void CleanDirectory(DirectoryPath path, bool force) 19 | { 20 | if (force && DirectoryExists(path)) 21 | { 22 | Verbose("Removing ReadOnly attributes on all files in directory {0}", path); 23 | foreach (var file in System.IO.Directory.GetFiles(MakeAbsolute(path).FullPath, "*", SearchOption.AllDirectories)) 24 | { 25 | System.IO.File.SetAttributes(file, System.IO.File.GetAttributes(file) & ~FileAttributes.ReadOnly); 26 | } 27 | } 28 | 29 | CleanDirectory(path); 30 | } -------------------------------------------------------------------------------- /build/git-util.cake: -------------------------------------------------------------------------------- 1 | 2 | /// 3 | /// Executes a command using git.exe. 4 | /// 5 | /// The directory of the git repository. This will be the working directory. Specify null to not change the directory (eg. for clone). 6 | /// The command to run. 7 | /// Any additional arguments to the command. 8 | void GitCommand(DirectoryPath repositoryDir, string command, params string[] args) 9 | { 10 | var gitPath = Context.Tools.Resolve("git.exe"); 11 | if (gitPath == null) 12 | throw new Exception($"Unable to resolve git.exe tool."); 13 | 14 | var argumentBuilder = new ProcessArgumentBuilder(); 15 | argumentBuilder.Append(command); 16 | foreach (var arg in args) 17 | argumentBuilder.Append(arg); 18 | 19 | int exitCode = StartProcess(gitPath, new ProcessSettings { 20 | WorkingDirectory = repositoryDir, 21 | Arguments = argumentBuilder, 22 | RedirectStandardOutput = true, 23 | RedirectStandardError = true 24 | }, out var stdOut, out var stdErr); 25 | 26 | foreach (var output in stdOut) 27 | Verbose(output); 28 | 29 | // Git apparently writes all messages to stderr... so we just write them as verbose. 30 | foreach (var output in stdErr) 31 | Verbose(output); 32 | 33 | if (exitCode != 0) 34 | { 35 | throw new Exception($"Git failed with exit code {exitCode}."); 36 | } 37 | } -------------------------------------------------------------------------------- /build/rest-util.cake: -------------------------------------------------------------------------------- 1 | #addin nuget:?package=RestSharp 2 | using RestSharp; 3 | using System.Net.Http.Headers; 4 | using System.Net.Http; 5 | using System.Net; 6 | 7 | /// Invokes a REST api. 8 | T RestInvoke(string baseUrl, string resource, Method method) where T : new() 9 | { 10 | var client = new RestClient(baseUrl); 11 | var request = new RestRequest(resource, method); 12 | Verbose($"{method} {baseUrl}/{resource}"); 13 | var result = client.Execute(request); 14 | if (result.StatusCode != HttpStatusCode.OK || !result.IsSuccessful) 15 | { 16 | throw new Exception($"REST call to {baseUrl}/{resource} failed with status {result.StatusCode}. Error message: {result.ErrorMessage}"); 17 | } 18 | return result.Data; 19 | } -------------------------------------------------------------------------------- /cake.config: -------------------------------------------------------------------------------- 1 | ; This is the default configuration file for Cake. 2 | ; This file was downloaded from https://github.com/cake-build/resources 3 | 4 | [Nuget] 5 | Source=https://api.nuget.org/v3/index.json 6 | UseInProcessClient=true 7 | LoadDependencies=false 8 | 9 | [Paths] 10 | Tools=./tools 11 | Addins=./tools/Addins 12 | Modules=./tools/Modules 13 | 14 | [Settings] 15 | SkipVerification=false 16 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # folder # 3 | ############### 4 | /**/DROP/ 5 | /**/TEMP/ 6 | /**/packages/ 7 | /**/bin/ 8 | /**/obj/ 9 | _site 10 | -------------------------------------------------------------------------------- /docs/api/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # temp file # 3 | ############### 4 | *.yml 5 | .manifest 6 | -------------------------------------------------------------------------------- /docs/api/index.md: -------------------------------------------------------------------------------- 1 | # AlphaFS API Reference 2 | 3 | 4 | @Alphaleonis.Win32 5 | 6 | This namespace contains general classes related to the Win32 Api. 7 | 8 | @Alphaleonis.Win32.Filesystem 9 | 10 | The @Alphaleons.Win32.Filesystem namespace contains classes to access and work with the local filesystem. Many of the classes in this namespace are replicas of the ones available in the System.IO namespace, but with added functionality. All methods in this namespace accept long windows unicode paths (i.e. paths starting with `\\?\`). 11 | 12 | @Alphaleonis.Win32.Network 13 | 14 | This namespace contains network related classes. 15 | 16 | @Alphaleonis.Win32.Security 17 | 18 | This namespace contains classes directly related to security such as authentication, authorization and privilege tokens that may be needed for some file operations. For an example the `SE_SECURITY_NAME` privilege needs to be held to be able to modify the SACL of any file. 19 | -------------------------------------------------------------------------------- /docs/apidoc/namespaces/Alphaleonis.Win32.FileSystem.md: -------------------------------------------------------------------------------- 1 | --- 2 | uid: Alphaleonis.Win32.Filesystem 3 | conceptual: *content 4 | --- 5 | The `Filesystem` namespace contains classes to access and work with the local filesystem. Many of the classes in this namespace are replicas of the ones available in the System.IO namespace, but with added functionality. All methods in this namespace accept long windows unicode paths (i.e. paths starting with `\\?\`). 6 | 7 | Additional classes and methods are provided to provide more advanced functionality than that of `System.IO`. -------------------------------------------------------------------------------- /docs/apidoc/namespaces/Alphaleonis.Win32.Network.md: -------------------------------------------------------------------------------- 1 | --- 2 | uid: Alphaleonis.Win32.Network 3 | conceptual: *content 4 | --- 5 | This namespace contains network related classes. -------------------------------------------------------------------------------- /docs/apidoc/namespaces/Alphaleonis.Win32.Security.md: -------------------------------------------------------------------------------- 1 | --- 2 | uid: Alphaleonis.Win32.Security 3 | conceptual: *content 4 | --- 5 | This namespace contains classes directly related to security such as authentication, authorization and privilege tokens that may be needed for some file operations. For an example the `SE_SECURITY_NAME` privilege needs to be held to be able to modify the SACL of any file. -------------------------------------------------------------------------------- /docs/apidoc/namespaces/Alphaleonis.Win32.md: -------------------------------------------------------------------------------- 1 | --- 2 | uid: Alphaleonis.Win32 3 | conceptual: *content 4 | --- 5 | This namespace contains general classes related to the Win32 Api. -------------------------------------------------------------------------------- /docs/articles/exceptions.md: -------------------------------------------------------------------------------- 1 | # Exceptions 2 | 3 | AlphaFS implements a few custom Exceptions: 4 | 5 | Inherited from @System.IO.IOException: 6 | 7 | AlreadyExistsException 8 | DeviceNotReadyException 9 | DirectoryNotEmptyException 10 | NotAReparsePointException 11 | UnrecognizedReparsePointException 12 | 13 | 14 | Inherited from @System.UnauthorizedAccessException: 15 | 16 | DirectoryReadOnlyException 17 | FileReadOnlyException 18 | 19 | 20 | Inherited from @System.SystemException: 21 | 22 | InvalidTransactionException 23 | TransactionalConflictException 24 | TransactionAlreadyAbortedException 25 | TransactionAlreadyCommittedException 26 | UnsupportedRemoteTransactionException 27 | 28 | **[TODO: Add links to the above classes]** -------------------------------------------------------------------------------- /docs/articles/methods-without-long-path-support.md: -------------------------------------------------------------------------------- 1 | --- 2 | uid: methods-without-long-path-support 3 | --- 4 | # Methods without long path support 5 | 6 | > [!CAUTION] 7 | > The following AlphaFS methods do not support long paths, due to MAX_PATH limitation of the Win32 API functions. 8 | * `Directory/DirectoryInfo.DisableEncryption` 9 | * `Directory/DirectoryInfo.EnableEncryption` 10 | * `File.CreateSymbolicLink()` 11 | * `Shell32.GetFileAssociation()` 12 | * `Shell32.GetFileIcon()` 13 | * `Shell32.GetFileInfo()` 14 | 15 | > [!NOTE] 16 | > The following AlphaFS methods, with long path support, will work on Windows 10, version 1607 17 | 18 | * `Directory.CurrentDirectory` 19 | * `Directory.SetCurrentDirectory` 20 | * `File.CreateHardlink` 21 | * `File.CreateSymbolicLink` 22 | * `File.EnumerateHardlinks` 23 | * `File.GetCompressedSize` 24 | 25 | **[TODO: Add links to the methods above]** -------------------------------------------------------------------------------- /docs/articles/powershell/intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | uid: powershell 3 | --- 4 | ## Getting Started with AlphaFS in PowerShell 5 | 6 | * Make sure that AlphaFS.dll is not blocked, due to archive [download](https://github.com/alphaleonis/AlphaFS/releases). 7 | * Check: _File Properties_ > _Details_ and click button/checkmark "**Unblock**" if shown. 8 | * Also, make sure you use the correct .NET version of the AlphaFS.dll file. 9 | 10 | **1. Get the currently used .NET version** 11 | 12 | PS C:\> $PSVersionTable.CLRVersion 13 | 14 | Major Minor Build Revision 15 | ----- ----- ----- -------- 16 | 4 0 30319 42000 17 | 18 | 19 | **2. Import Module** 20 | 21 | # Load AlphaFS (Method 1). 22 | PS C:\> Import-Module -Name 'C:\AlphaFS 2.2\Lib\Net4.0\AlphaFS.dll' 23 | 24 | # Load AlphaFS (Method 2). 25 | # Returns a System.Reflection.Assembly instance. 26 | PS C:\> $assembly = [Reflection.Assembly]::LoadFile('C:\AlphaFS 2.2\Lib\Net4.0\AlphaFS.dll') 27 | PS C:\> $assembly 28 | 29 | GAC Version Location 30 | --- ------- -------- 31 | False v4.0.30319 C:\AlphaFS 2.2\Lib\Net4.0\AlphaFS.dll 32 | 33 | **3. AlphaFS Classes** 34 | 35 | (.NET) Alphaleonis.Win32.Filesystem.Directory 36 | (.NET) Alphaleonis.Win32.Filesystem.DirectoryInfo 37 | (.NET) Alphaleonis.Win32.Filesystem.File 38 | (.NET) Alphaleonis.Win32.Filesystem.FileInfo 39 | (.NET) Alphaleonis.Win32.Filesystem.Path 40 | (AlphaFS) Alphaleonis.Win32.Filesystem.Device 41 | (AlphaFS) Alphaleonis.Win32.Network.Host 42 | 43 | A plethora of functions (methods) is available, check the documentation at the 44 | website: [http://alphafs.alphaleonis.com](http://alphafs.alphaleonis.com) 45 | -------------------------------------------------------------------------------- /docs/articles/powershell/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Getting Started 2 | href: intro.md 3 | - name: Examples 4 | href: examples.md -------------------------------------------------------------------------------- /docs/articles/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Introduction 2 | href: intro.md 3 | - name: PowerShell 4 | href: powershell/toc.yml 5 | topicHref: powershell/intro.md 6 | - name: Exceptions 7 | href: exceptions.md 8 | - name: Differences from System.IO 9 | href: differences.md 10 | items: 11 | - name: No Long Path Support 12 | href: methods-without-long-path-support.md 13 | 14 | -------------------------------------------------------------------------------- /docs/docfx.json: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": [ 3 | { 4 | "src": [ 5 | { 6 | "files": [ 7 | "src/**.csproj" 8 | ], 9 | "cwd": "..", 10 | } 11 | ], 12 | "dest": "api", 13 | "disableGitFeatures": false, 14 | "disableDefaultFilter": false, 15 | "properties": { 16 | "TargetFramework": "net47" 17 | } 18 | } 19 | ], 20 | "build": { 21 | "content": [ 22 | { 23 | "files": [ 24 | "api/**.yml", 25 | "api/index.md" 26 | ] 27 | }, 28 | { 29 | "files": [ 30 | "articles/**.md", 31 | "articles/**/toc.yml", 32 | "toc.yml", 33 | "*.md" 34 | ] 35 | }, 36 | { 37 | "files": [ 38 | "CHANGELOG.md" 39 | ], 40 | "cwd": ".." 41 | } 42 | ], 43 | "xrefservice": [ 44 | "https://xref.docs.microsoft.com/query?uid={uid}" 45 | ], 46 | "resource": [ 47 | { 48 | "files": [ 49 | "images/**" 50 | ] 51 | } 52 | ], 53 | "overwrite": [ 54 | { 55 | "files": [ 56 | "apidoc/**.md" 57 | ], 58 | "exclude": [ 59 | "obj/**", 60 | "_site/**" 61 | ] 62 | } 63 | ], 64 | "dest": "../artifacts/docs", 65 | "globalMetadata": { 66 | "_appTitle": "AlphaFS", 67 | "_appFooter": "Copyright © 2018 AlphaFS contributors", 68 | "_enableSearch": true, 69 | "_appLogoPath": "images/logo.svg" 70 | }, 71 | "globalMetadataFiles": [], 72 | "fileMetadataFiles": [], 73 | "template": [ 74 | "default", 75 | "theme/alphaleonis" 76 | ], 77 | "postProcessors": [], 78 | "markdownEngineName": "markdig", 79 | "noLangKeyword": false, 80 | "keepFileLink": false, 81 | "cleanupCacheHistory": true, 82 | "disableGitFeatures": false 83 | } 84 | } -------------------------------------------------------------------------------- /docs/theme/alphaleonis/styles/main.css: -------------------------------------------------------------------------------- 1 | svg#logo:hover path#bg { 2 | fill: #61ace6; 3 | } 4 | -------------------------------------------------------------------------------- /docs/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Documentation 2 | href: articles/ 3 | - name: Api Reference 4 | href: api/ 5 | homepage: api/index.md 6 | - name: Changelog 7 | href: ../CHANGELOG.md 8 | - name: GitHub 9 | href: https://github.com/alphaleonis/AlphaFS 10 | -------------------------------------------------------------------------------- /src/AlphaFS/AlphaFS.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/AlphaFS/AssemblyVersionInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | using System.Reflection; 22 | using System.Resources; 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/AlphaFS/Device/Volume/Volume.IsReady.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | public static partial class Volume 27 | { 28 | /// [AlphaFS] Gets a value indicating whether a drive is ready. 29 | /// 30 | /// A path to a drive. For example: "C:\", "\\server\share", or "\\?\Volume{c0580d5e-2ad6-11dc-9924-806e6f6e6963}\". 31 | /// 32 | /// true if is ready; otherwise, false. 33 | [SecurityCritical] 34 | public static bool IsReady(string drivePath) 35 | { 36 | return File.ExistsCore(null, true, drivePath, PathFormat.FullPath); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/AlphaFS/Device/Volume/Volume.IsVolume.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | public static partial class Volume 27 | { 28 | /// [AlphaFS] Determines whether the specified volume name is a defined volume on the current computer. 29 | /// 30 | /// A path to a volume. For example: "C:\", "\\server\share", or "\\?\Volume{c0580d5e-2ad6-11dc-9924-806e6f6e6963}\". 31 | /// 32 | /// true on success, false otherwise. 33 | [SecurityCritical] 34 | public static bool IsVolume(string volumeMountPoint) 35 | { 36 | return !Utils.IsNullOrWhiteSpace(GetVolumeGuid(volumeMountPoint)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/AlphaFS/Device/Volume/Volume.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Filesystem 23 | { 24 | /// [AlphaFS] Static class providing utility methods for working with Microsoft Windows devices and volumes. 25 | public static partial class Volume 26 | { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/CopyMoveProgressRoutine.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Filesystem 23 | { 24 | /// Callback used by CopyFileXxx and MoveFileXxx to report progress about the copy/move operation. 25 | public delegate CopyMoveProgressResult CopyMoveProgressRoutine(long totalFileSize, long totalBytesTransferred, long streamSize, long streamBytesTransferred, int streamNumber, CopyMoveProgressCallbackReason callbackReason, object userData); 26 | } 27 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Directory Class/Directory.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Diagnostics.CodeAnalysis; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | /// Exposes static methods for creating, moving, and enumerating through directories and subdirectories. 27 | /// This class cannot be inherited. 28 | /// 29 | [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] 30 | public static partial class Directory 31 | { 32 | // This file only exists for the documentation. 33 | } 34 | } -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/DirectoryInfo Class/DirectoryInfo Compression/DirectoryInfo.DisableCompression.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | public sealed partial class DirectoryInfo 27 | { 28 | /// [AlphaFS] Disables compression of the specified directory and the files in it. 29 | /// 30 | /// This method disables the directory-compression attribute. It will not decompress the current contents of the directory. 31 | /// However, newly created files and directories will be uncompressed. 32 | /// 33 | [SecurityCritical] 34 | public void DisableCompression() 35 | { 36 | Device.ToggleCompressionCore(Transaction, true, LongFullName, false, PathFormat.LongFullPath); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/DirectoryInfo Class/DirectoryInfo Compression/DirectoryInfo.EnableCompression.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | public sealed partial class DirectoryInfo 27 | { 28 | /// [AlphaFS] Enables compression of the specified directory and the files in it. 29 | /// 30 | /// This method enables the directory-compression attribute. It will not compress the current contents of the directory. 31 | /// However, newly created files and directories will be compressed. 32 | /// 33 | [SecurityCritical] 34 | public void EnableCompression() 35 | { 36 | Device.ToggleCompressionCore(Transaction, true, LongFullName, true, PathFormat.LongFullPath); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/DirectoryInfo Class/DirectoryInfo Encryption/DirectoryInfo.EnableEncryption.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | public sealed partial class DirectoryInfo 27 | { 28 | /// [AlphaFS] Enables encryption of the specified directory and the files in it. It does not affect encryption of subdirectories below the indicated directory. 29 | /// true on success, false otherwise. 30 | /// This method will create/change the file "Desktop.ini" and wil set Encryption value: "Disable=1" 31 | [SecurityCritical] 32 | public void EnableEncryption() 33 | { 34 | Directory.EnableDisableEncryptionCore(LongFullName, true, PathFormat.LongFullPath); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/DirectoryInfo Class/DirectoryInfo.EnumerateAlternateDataStreams.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Collections.Generic; 23 | using System.Security; 24 | 25 | namespace Alphaleonis.Win32.Filesystem 26 | { 27 | public sealed partial class DirectoryInfo 28 | { 29 | /// [AlphaFS] Returns an enumerable collection of instances for the directory. 30 | /// An enumerable collection of instances for the directory. 31 | [SecurityCritical] 32 | public IEnumerable EnumerateAlternateDataStreams() 33 | { 34 | return File.EnumerateAlternateDataStreamsCore(Transaction, true, LongFullName, PathFormat.LongFullPath); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/DirectoryInfo Class/DirectoryInfo.RefreshEntryInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | public sealed partial class DirectoryInfo 27 | { 28 | /// [AlphaFS] Refreshes the state of the EntryInfo property. 29 | [SecurityCritical] 30 | public new void RefreshEntryInfo() 31 | { 32 | base.RefreshEntryInfo(); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/File Class/File Core Methods/File.AppendTextCore.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alphaleonis/AlphaFS/7abc4ed0179ec01e0e1cd32d87ccde8a4cf3297c/src/AlphaFS/Filesystem/File Class/File Core Methods/File.AppendTextCore.cs -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/File Class/File.AppendText.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alphaleonis/AlphaFS/7abc4ed0179ec01e0e1cd32d87ccde8a4cf3297c/src/AlphaFS/Filesystem/File Class/File.AppendText.cs -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/File Class/File.AppendTextTransacted.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alphaleonis/AlphaFS/7abc4ed0179ec01e0e1cd32d87ccde8a4cf3297c/src/AlphaFS/Filesystem/File Class/File.AppendTextTransacted.cs -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/File Class/File.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Filesystem 23 | { 24 | /// Provides static methods for the creation, copying, deletion, moving, and opening of a single file, and aids in the creation of FileStream objects. 25 | public static partial class File 26 | { 27 | // This file only exists for the documentation. 28 | } 29 | } -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo Compression/FileInfo.Compress.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | partial class FileInfo 27 | { 28 | /// [AlphaFS] Compresses a file using NTFS compression. 29 | [SecurityCritical] 30 | public void Compress() 31 | { 32 | Device.ToggleCompressionCore(Transaction, false, LongFullName, true, PathFormat.LongFullPath); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo Compression/FileInfo.Decompress.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | partial class FileInfo 27 | { 28 | /// [AlphaFS] Decompresses an NTFS compressed file. 29 | [SecurityCritical] 30 | public void Decompress() 31 | { 32 | Device.ToggleCompressionCore(Transaction, false, LongFullName, false, PathFormat.LongFullPath); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo Encryption/FileInfo.Decrypt.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | partial class FileInfo 27 | { 28 | #region .NET 29 | 30 | /// Decrypts a file that was encrypted by the current account using the Encrypt method. 31 | [SecurityCritical] 32 | public void Decrypt() 33 | { 34 | File.EncryptDecryptFileCore(false, LongFullName, false, PathFormat.LongFullPath); 35 | } 36 | 37 | #endregion // .NET 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo Encryption/FileInfo.Encrypt.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | partial class FileInfo 27 | { 28 | #region .NET 29 | 30 | /// Encrypts a file so that only the account used to encrypt the file can decrypt it. 31 | [SecurityCritical] 32 | public void Encrypt() 33 | { 34 | File.EncryptDecryptFileCore(false, LongFullName, true, PathFormat.LongFullPath); 35 | } 36 | 37 | #endregion // .NET 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo.Create.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.IO; 23 | using System.Security; 24 | 25 | namespace Alphaleonis.Win32.Filesystem 26 | { 27 | partial class FileInfo 28 | { 29 | #region .NET 30 | 31 | /// Creates a file. 32 | /// A new file. 33 | [SecurityCritical] 34 | public FileStream Create() 35 | { 36 | return File.CreateFileStreamCore(Transaction, LongFullName, ExtendedFileAttributes.Normal, null, FileMode.Create, FileAccess.ReadWrite, FileShare.None, NativeMethods.DefaultFileBufferSize, PathFormat.LongFullPath); 37 | } 38 | 39 | #endregion // .NET 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo.EnumerateAlternateDataStreams.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Collections.Generic; 23 | using System.Security; 24 | 25 | namespace Alphaleonis.Win32.Filesystem 26 | { 27 | partial class FileInfo 28 | { 29 | /// [AlphaFS] Returns an enumerable collection of instances for the file. 30 | /// An enumerable collection of instances for the file. 31 | [SecurityCritical] 32 | public IEnumerable EnumerateAlternateDataStreams() 33 | { 34 | return File.EnumerateAlternateDataStreamsCore(Transaction, false, LongFullName, PathFormat.LongFullPath); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo.GetHash.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Alphaleonis.Win32.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | partial class FileInfo 27 | { 28 | /// [AlphaFS] Calculates the hash/checksum. 29 | /// One of the values. 30 | /// The hash/checksum of the file represented by this . 31 | public string GetHash(HashType hashType) 32 | { 33 | return File.GetHashCore(Transaction, LongFullName, hashType, PathFormat.LongFullPath); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo.IsLocked.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | partial class FileInfo 27 | { 28 | /// [AlphaFS] Compresses a file using NTFS compression. 29 | /// Returns true if the specified file is in use (locked); otherwise, false 30 | [SecurityCritical] 31 | public bool IsLocked() 32 | { 33 | return File.IsLockedCore(Transaction, LongFullName, PathFormat.LongFullPath); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo.OpenRead.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.IO; 23 | using System.Security; 24 | 25 | namespace Alphaleonis.Win32.Filesystem 26 | { 27 | partial class FileInfo 28 | { 29 | /// Creates a read-only . 30 | /// A new read-only object. 31 | /// This method returns a read-only object with the mode set to Read. 32 | [SecurityCritical] 33 | public FileStream OpenRead() 34 | { 35 | return File.OpenCore(Transaction, LongFullName, FileMode.Open, FileAccess.Read, FileShare.Read, ExtendedFileAttributes.Normal, null, null, PathFormat.LongFullPath); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo.OpenWrite.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.IO; 23 | using System.Security; 24 | 25 | namespace Alphaleonis.Win32.Filesystem 26 | { 27 | partial class FileInfo 28 | { 29 | #region .NET 30 | 31 | /// Creates a write-only . 32 | /// A write-only unshared object for a new or existing file. 33 | [SecurityCritical] 34 | public FileStream OpenWrite() 35 | { 36 | return File.OpenCore(Transaction, LongFullName, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None, ExtendedFileAttributes.Normal, null, null, PathFormat.LongFullPath); 37 | } 38 | 39 | #endregion // .NET 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/FileInfo Class/FileInfo.RefreshEntryInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | partial class FileInfo 27 | { 28 | /// [AlphaFS] Refreshes the state of the EntryInfo property. 29 | [SecurityCritical] 30 | public new void RefreshEntryInfo() 31 | { 32 | base.RefreshEntryInfo(); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Link Stream/LinkTargetInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Filesystem 23 | { 24 | /// Information about the target of a symbolic link or mount point. 25 | public class LinkTargetInfo 26 | { 27 | internal LinkTargetInfo(string substituteName, string printName) 28 | { 29 | SubstituteName = substituteName; 30 | 31 | PrintName = Path.RemoveTrailingDirectorySeparator(printName ?? Path.GetRegularPathCore(substituteName, GetFullPathOptions.None, false)); 32 | } 33 | 34 | 35 | /// The print name. 36 | public string PrintName { get; private set; } 37 | 38 | 39 | /// The substitute name. 40 | public string SubstituteName { get; private set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Link Stream/SymbolicLinkTargetInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Filesystem 23 | { 24 | /// Represents information about a symbolic link. 25 | public class SymbolicLinkTargetInfo : LinkTargetInfo 26 | { 27 | internal SymbolicLinkTargetInfo(string substituteName, string printName, SymbolicLinkType type) : base(substituteName, printName) 28 | { 29 | LinkType = type; 30 | } 31 | 32 | /// Gets the type of the link. 33 | /// The type of the link. 34 | public SymbolicLinkType LinkType { get; private set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Native Other/FIND_FIRST_EX_FLAGS.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | internal static partial class NativeMethods 27 | { 28 | /// Additional flags that control the search. 29 | [Flags] 30 | internal enum FIND_FIRST_EX_FLAGS 31 | { 32 | /// No additional flags used. 33 | NONE = 0, 34 | 35 | /// Searches are case-sensitive. 36 | CASE_SENSITIVE = 1, 37 | 38 | /// Uses a larger buffer for directory queries, which can increase performance of the find operation. 39 | /// This value is not supported until Windows Server 2008 R2 and Windows 7. 40 | LARGE_FETCH = 2 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Native Other/GET_FILEEX_INFO_LEVELS.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Filesystem 23 | { 24 | internal static partial class NativeMethods 25 | { 26 | /// Defines values that are used with the GetFileAttributesEx and GetFileAttributesTransacted functions to specify the information level of the returned data. 27 | public enum GET_FILEEX_INFO_LEVELS 28 | { 29 | /// The GetFileAttributesEx or GetFileAttributesTransacted function retrieves a standard set of attribute information. The data is returned in a WIN32_FILE_ATTRIBUTE_DATA structure. 30 | GetFileExInfoStandard = 0 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Native Other/SymbolicLinkReparseBuffer.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Runtime.InteropServices; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | internal static partial class NativeMethods 27 | { 28 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 29 | internal struct SymbolicLinkReparseBuffer 30 | { 31 | public ushort SubstituteNameOffset; 32 | public ushort SubstituteNameLength; 33 | public ushort PrintNameOffset; 34 | public ushort PrintNameLength; 35 | public SymbolicLinkType Flags; 36 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] data; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Native Other/WIN32_FIND_STREAM_DATA.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Runtime.InteropServices; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | internal static partial class NativeMethods 27 | { 28 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 29 | internal struct WIN32_FIND_STREAM_DATA 30 | { 31 | public long StreamSize; 32 | 33 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MaxPath + 36)] 34 | public string cStreamName; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Path Class/Path Core Methods/Path.GetTempPathCore.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | public static partial class Path 27 | { 28 | /// Returns the path of the current user's temporary folder. 29 | /// The folder name to append to the temporary folder. 30 | /// The path to the temporary folder, combined with . 31 | [SecurityCritical] 32 | internal static string GetTempPathCore(string combinePath) 33 | { 34 | var tempPath = System.IO.Path.GetTempPath(); 35 | 36 | return !Utils.IsNullOrWhiteSpace(combinePath) ? CombineCore(false, tempPath, combinePath) : tempPath; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Path Class/Path.Combine.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using System.Security; 24 | 25 | namespace Alphaleonis.Win32.Filesystem 26 | { 27 | public static partial class Path 28 | { 29 | /// Combines an array of strings into a path. 30 | /// The combined paths. 31 | /// 32 | /// 33 | /// An array of parts of the path. 34 | [SecurityCritical] 35 | public static string Combine(params string[] paths) 36 | { 37 | return CombineCore(true, paths); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Path Class/Path.GetInvalidFileNameChars.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | public static partial class Path 27 | { 28 | #region .NET 29 | 30 | /// Gets an array containing the characters that are not allowed in file names. 31 | /// An array containing the characters that are not allowed in file names. 32 | [SecurityCritical] 33 | public static char[] GetInvalidFileNameChars() 34 | { 35 | return System.IO.Path.GetInvalidFileNameChars(); 36 | } 37 | 38 | #endregion // .NET 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Path Class/Path.GetInvalidPathChars.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Security; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | public static partial class Path 27 | { 28 | #region .NET 29 | 30 | /// Gets an array containing the characters that are not allowed in path names. 31 | /// An array containing the characters that are not allowed in path names. 32 | [SecurityCritical] 33 | public static char[] GetInvalidPathChars() 34 | { 35 | return System.IO.Path.GetInvalidPathChars(); 36 | } 37 | 38 | #endregion // .NET 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Path Class/Path.GetLongFrom83ShortPath.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using System.Security; 24 | 25 | namespace Alphaleonis.Win32.Filesystem 26 | { 27 | public static partial class Path 28 | { 29 | /// [AlphaFS] Converts the specified existing path to its regular long form. 30 | /// The regular full path. 31 | /// 32 | /// 33 | /// An existing path to a folder or file. 34 | [SecurityCritical] 35 | public static string GetLongFrom83ShortPath(string path) 36 | { 37 | return GetLongShort83PathCore(null, path, false); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Path Class/Path.GetRandomFileName.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Diagnostics.CodeAnalysis; 23 | using System.Security; 24 | 25 | namespace Alphaleonis.Win32.Filesystem 26 | { 27 | public static partial class Path 28 | { 29 | #region .NET 30 | 31 | /// Returns a random folder name or file name. 32 | /// A random folder name or file name. 33 | [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] 34 | [SecurityCritical] 35 | public static string GetRandomFileName() 36 | { 37 | return System.IO.Path.GetRandomFileName(); 38 | } 39 | 40 | #endregion // .NET 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Path Class/Path.GetTempFileName.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Diagnostics.CodeAnalysis; 23 | using System.Security; 24 | 25 | namespace Alphaleonis.Win32.Filesystem 26 | { 27 | public static partial class Path 28 | { 29 | #region .NET 30 | 31 | /// Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file. 32 | /// The full path of the temporary file. 33 | [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] 34 | [SecurityCritical] 35 | public static string GetTempFileName() 36 | { 37 | return System.IO.Path.GetTempFileName(); 38 | } 39 | 40 | #endregion // .NET 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Path Class/Path.IsValidName.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | 24 | namespace Alphaleonis.Win32.Filesystem 25 | { 26 | public static partial class Path 27 | { 28 | /// [AlphaFS] Check if file or folder name has any invalid characters. 29 | /// 30 | /// File or folder name. 31 | /// true if name contains any invalid characters. Otherwise false 32 | public static bool IsValidName(string name) 33 | { 34 | if (null == name) 35 | throw new ArgumentNullException("name"); 36 | 37 | return name.IndexOfAny(GetInvalidFileNameChars()) < 0; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Path Class/Path.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Filesystem 23 | { 24 | /// Performs operations on String instances that contain file or directory path information. These operations are performed in a cross-platform manner. 25 | public static partial class Path 26 | { 27 | // This file only exists for the documentation. 28 | } 29 | } -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Structures, Enumerations/CopyMoveProgressCallbackReason.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Filesystem 23 | { 24 | /// Used by CopyFileXxx and MoveFileXxx. The reason that was called. 25 | public enum CopyMoveProgressCallbackReason 26 | { 27 | /// CALLBACK_CHUNK_FINISHED 28 | /// Another part of the data file was copied. 29 | /// 30 | ChunkFinished = 0, 31 | 32 | /// CALLBACK_STREAM_SWITCH 33 | /// Another stream was created and is about to be copied. This is the callback reason given when the callback routine is first invoked. 34 | /// 35 | StreamSwitch = 1 36 | } 37 | } -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Structures, Enumerations/SymbolicLinkTarget.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Filesystem 23 | { 24 | /// Indicates whether the link target is a file or directory. 25 | /// Used by Win32 API CreateSymbolicLink()/CreateSymbolicLinkTransacted() 26 | public enum SymbolicLinkTarget 27 | { 28 | /// The link target is a file. 29 | File = 0, 30 | 31 | /// The link target is a directory. 32 | Directory = 1 33 | } 34 | } -------------------------------------------------------------------------------- /src/AlphaFS/Filesystem/Structures, Enumerations/SymbolicLinkType.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Filesystem 23 | { 24 | /// Specifies the type of a symbolic link. 25 | public enum SymbolicLinkType 26 | { 27 | /// The symbolic link is absolute. 28 | Absolute = 0, 29 | 30 | /// The symbolic link is relative. 31 | Relative = 1 32 | } 33 | } -------------------------------------------------------------------------------- /src/AlphaFS/Network/Enumerations/DomainType.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Network 23 | { 24 | /// Specifies the domain type of a network. 25 | public enum DomainType 26 | { 27 | /// The Network is not an Active Directory Network. 28 | None = 0, 29 | 30 | 31 | /// The Network is an Active Directory Network, but this machine is not authenticated against it. 32 | DomainNetwork = 1, 33 | 34 | 35 | /// The Network is an Active Directory Network, and this machine is authenticated against it. 36 | DomainAuthenticated = 2 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/AlphaFS/Network/Enumerations/NetworkCategory.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Network 23 | { 24 | /// Specifies the category type of a network. 25 | public enum NetworkCategory 26 | { 27 | /// The network is a public (untrusted) network. 28 | Public, 29 | 30 | /// The network is a private (trusted) network. 31 | Private, 32 | 33 | /// The network is authenticated against an Active Directory domain. 34 | Authenticated 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/AlphaFS/Network/Enumerations/NetworkConnectivityLevels.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | 24 | namespace Alphaleonis.Win32.Network 25 | { 26 | /// Specifies what types of networks are enumerated. 27 | [Flags] 28 | public enum NetworkConnectivityLevels 29 | { 30 | /// Unknown. 31 | None = 0, 32 | 33 | /// Returns connected networks. 34 | Connected = 1, 35 | 36 | /// Returns disconnected networks. 37 | Disconnected = 2, 38 | 39 | /// Returns connected and disconnected networks. 40 | All = Connected | Disconnected 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/AlphaFS/Safe Handles/SafeEncryptedFileRawHandle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security; 3 | using Microsoft.Win32.SafeHandles; 4 | 5 | namespace Alphaleonis.Win32.Filesystem 6 | { 7 | /// Represents a wrapper class for a handle used by the OpenEncryptedFileRaw Win32 API functions. 8 | [SecurityCritical] 9 | internal sealed class SafeEncryptedFileRawHandle : SafeHandleZeroOrMinusOneIsInvalid 10 | { 11 | /// Constructor that prevents a default instance of this class from being created. 12 | private SafeEncryptedFileRawHandle() : base(true) 13 | { 14 | } 15 | 16 | 17 | /// Initializes a new instance of the class. 18 | /// The handle. 19 | /// true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended). 20 | public SafeEncryptedFileRawHandle(IntPtr handle, bool callerHandle) : base(callerHandle) 21 | { 22 | SetHandle(handle); 23 | } 24 | 25 | 26 | /// When overridden in a derived class, executes the code required to free the handle. 27 | /// 28 | /// true if the handle is released successfully; otherwise, in the event of a catastrophic failure, 29 | /// false. In this case, it generates a ReleaseHandleFailed Managed Debugging Assistant. 30 | /// 31 | protected override bool ReleaseHandle() 32 | { 33 | NativeMethods.CloseEncryptedFileRaw(handle); 34 | 35 | return true; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/AlphaFS/Security/Native Methods/NativeMethods.Constants.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | namespace Alphaleonis.Win32.Security 23 | { 24 | internal static partial class NativeMethods 25 | { 26 | /// Combines DELETE, READ_CONTROL, WRITE_DAC, and WRITE_OWNER access. 27 | public const uint STANDARD_RIGHTS_REQUIRED = 983040; 28 | 29 | /// The right to read the information in the object's security descriptor, not including the information in the system access control list (SACL). 30 | public const uint STANDARD_RIGHTS_READ = 131072; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/AlphaFS/Utils.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alphaleonis/AlphaFS/7abc4ed0179ec01e0e1cd32d87ccde8a4cf3297c/src/AlphaFS/Utils.cs -------------------------------------------------------------------------------- /src/AlphaFS/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/AlphaFS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS BackupFileStream Class/AlphaFS_BackupFileStreamTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all BackupFileStream class Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_BackupFileStreamTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS ByHandleFileInfo Class/AlphaFS_ByHandleFileInfoTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all ByHandleFileInfo class Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_ByHandleFileInfoTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS CRC Class/AlphaFS_CrcTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all CRC Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_CrcTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Compression/AlphaFS CompressionTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Compression Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_CompressionTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Compression/AlphaFS_Directory.Compress_And_Decompress_Recursive.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | partial class AlphaFS_CompressionTest 27 | { 28 | // Pattern: ___ 29 | 30 | 31 | [TestMethod] 32 | public void AlphaFS_Directory_Compress_And_Decompress_Recursive_LocalAndNetwork_Success() 33 | { 34 | AlphaFS_Directory_Compress_And_Decompress(false, true); 35 | AlphaFS_Directory_Compress_And_Decompress(true, true); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Device Class/AlphaFS Volume Class/AlphaFS_VolumeTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Volume class Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_VolumeTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Device Class/DriveInfo Class/DriveInfoTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all DriveInfo class Unit Tests. 27 | [TestClass] 28 | public partial class DriveInfoTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Encryption/AlphaFS_EncryptionTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Encryption Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_EncryptionTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS FileIdInfo Class/AlphaFS_FileIdInfoTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all FileIdInfo class Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_FileIdInfoTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS FileSystemEntryInfo Class/AlphaFS_FileSystemEntryInfoTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all FileSystemEntryInfo class Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_FileSystemEntryInfoTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Host Class/AlphaFS_Host.GetWorkstationStatistics.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | public partial class AlphaFS_HostTest 28 | { 29 | // Pattern: ___ 30 | 31 | 32 | [TestMethod] 33 | public void AlphaFS_Host_GetWorkstationStatistics_Success() 34 | { 35 | UnitTestConstants.PrintUnitTestHeader(false); 36 | 37 | var host = Environment.MachineName; 38 | 39 | Console.WriteLine("Input Host Name: [{0}]", host); 40 | 41 | var workstationStat = Alphaleonis.Win32.Network.Host.GetWorkstationStatistics(host); 42 | 43 | UnitTestConstants.Dump(workstationStat); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Host Class/AlphaFS_HostTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Host class Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_HostTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Junctions, Links/AlphaFS_JunctionsLinksTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Junctions and Links Unit Tests. 27 | /// 28 | [TestClass] 29 | public partial class AlphaFS_JunctionsLinksTest 30 | { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Shell32 Class/AlphaFS_Shell32Test..cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Shell32 and Shell32Info class Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_Shell32Test 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Shell32 Class/AlphaFS_Shell32Test.PathCreateFromUrl.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | public partial class AlphaFS_Shell32Test 28 | { 29 | [TestMethod] 30 | public void AlphaFS_Shell32_PathCreateFromUrl() 31 | { 32 | var folder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 33 | 34 | var urlPath = Alphaleonis.Win32.Filesystem.Shell32.UrlCreateFromPath(folder); 35 | 36 | var filePath = Alphaleonis.Win32.Filesystem.Shell32.PathCreateFromUrl(urlPath); 37 | 38 | Assert.IsTrue(urlPath.StartsWith("file:///")); 39 | 40 | Assert.IsTrue(filePath.Equals(folder)); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Shell32 Class/AlphaFS_Shell32Test.PathCreateFromUrlAlloc.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | public partial class AlphaFS_Shell32Test 28 | { 29 | [TestMethod] 30 | public void AlphaFS_Shell32_PathCreateFromUrlAlloc() 31 | { 32 | var folder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 33 | 34 | var urlPath = Alphaleonis.Win32.Filesystem.Shell32.UrlCreateFromPath(folder); 35 | 36 | var filePath = Alphaleonis.Win32.Filesystem.Shell32.PathCreateFromUrlAlloc(urlPath); 37 | 38 | Assert.IsTrue(urlPath.StartsWith("file:///")); 39 | 40 | Assert.IsTrue(filePath.Equals(folder)); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Shell32 Class/AlphaFS_Shell32Test.UrlIs.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | public partial class AlphaFS_Shell32Test 28 | { 29 | [TestMethod] 30 | public void AlphaFS_Shell32_UrlIs() 31 | { 32 | var urlPath = Alphaleonis.Win32.Filesystem.Shell32.UrlCreateFromPath(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)); 33 | 34 | var filePath = Alphaleonis.Win32.Filesystem.Shell32.PathCreateFromUrlAlloc(urlPath); 35 | 36 | Assert.IsTrue(Alphaleonis.Win32.Filesystem.Shell32.UrlIsFileUrl(urlPath)); 37 | 38 | Assert.IsFalse(Alphaleonis.Win32.Filesystem.Shell32.UrlIsFileUrl(filePath)); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/AlphaFS Utils Class/AlphaFS_UtilsTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Utils class Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_UtilsTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Directory Class/AlphaFS_Directory.CountFileSystemObjects/AlphaFS_Directory.CountFileSystemObjectsTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for Directory and is intended to contain all CountFileSystemObjects Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_Directory_CountFileSystemObjectsTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Directory Class/AlphaFS_Directory.DeleteEmptySubdirectories/AlphaFS_Directory.DeleteEmptySubdirectoriesTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for Directory and is intended to contain all DeleteEmptySubdirectories Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_Directory_DeleteEmptySubdirectoriesTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Directory Class/AlphaFS_Directory.IsEmpty/AlphaFS_Directory.IsEmptyTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for Directory and is intended to contain all IsEmpty Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_Directory_IsEmptyTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Directory Class/Directory.CreateDirectory/Directory.CreateDirectoryTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 27 | [TestClass] 28 | public partial class Directory_CreateDirectoryTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Directory Class/Directory.CreateDirectory/Directory.CreateDirectory_EmptyAsPath_ThrowsArgumentException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class Directory_CreateDirectoryTest 29 | { 30 | [TestMethod] 31 | public void CreateDirectory_EmptyAsPath_ThrowsArgumentException_Success() 32 | { 33 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.Directory.Delete(string.Empty)); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Directory Class/Directory.CreateDirectory/Directory.CreateDirectory_NullAsPath_ThrowsArgumentNullException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class Directory_CreateDirectoryTest 29 | { 30 | [TestMethod] 31 | public void Directory_CreateDirectory_NullAsPath_ThrowsArgumentNullException_Success() 32 | { 33 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.Directory.CreateDirectory(null)); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Directory Class/Directory.CurrentDirectory/Directory.CurrentDirectoryTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for Directory and is intended to contain all CurrentDirectory Unit Tests. 27 | [TestClass] 28 | public partial class Directory_CurrentDirectoryTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Directory Class/Directory.Delete/Directory.Delete_EmptyAsPath_ThrowsArgumentException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class DeleteTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void Directory_Delete_EmptyAsPath_ThrowsArgumentException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.Directory.Delete(string.Empty)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Directory Class/Directory.Delete/Directory.Delete_NullAsPath_ThrowsArgumentNullException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class DeleteTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void Directory_Delete_NullAsPath_ThrowsArgumentNullException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.Directory.Delete(null)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Directory Class/DirectoryTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Directory class Unit Tests. 27 | [TestClass] 28 | public partial class DirectoryTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/DirectoryInfo Class/DirectoryInfo.MoveTo/AlphaFS_DirectoryInfo.MoveTo_DelayUntilRebootFlagCombinedWithCopyAllowedFlagUsingUncPath_ThrowsArgumentException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation directorys (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | public partial class MoveTest 27 | { 28 | // Pattern: ___ 29 | 30 | 31 | [TestMethod] 32 | public void AlphaFS_DirectoryInfo_MoveTo_DelayUntilRebootFlagCombinedWithCopyAllowedFlagUsingUncPath_ThrowsArgumentException_Network_Success() 33 | { 34 | AlphaFS_DirectoryInfo_MoveTo_DelayUntilReboot(true); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/DirectoryInfo Class/DirectoryInfoTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all DirectoryInfo class Unit Tests. 27 | [TestClass] 28 | public partial class DirectoryInfoTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/AlphaFS_File_Lock/AlphaFS_File.LockTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for File and is intended to contain all Lock Unit Tests. 27 | [TestClass] 28 | public partial class AlphaFS_File_LockTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File.Copy/AlphaFS_File.Copy_Overwrite_DestinationFileAlreadyExists.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace AlphaFS.UnitTest 5 | { 6 | public partial class CopyTest 7 | { 8 | // Pattern: ___ 9 | 10 | 11 | [TestMethod] 12 | public void AlphaFS_File_Copy_Overwrite_DestinationFileAlreadyExists_LocalAndNetwork_Success() 13 | { 14 | AlphaFS_File_Copy_Overwrite_DestinationFileAlreadyExists(false); 15 | AlphaFS_File_Copy_Overwrite_DestinationFileAlreadyExists(true); 16 | } 17 | 18 | 19 | private void AlphaFS_File_Copy_Overwrite_DestinationFileAlreadyExists(bool isNetwork) 20 | { 21 | using (var tempRoot = new TemporaryDirectory(isNetwork)) 22 | { 23 | var srcFile = tempRoot.CreateFile(); 24 | var dstFile = tempRoot.CreateFile(); 25 | 26 | Console.WriteLine("Src File Path: [{0}]", srcFile.FullName); 27 | Console.WriteLine("Dst File Path: [{0}]", dstFile.FullName); 28 | 29 | 30 | UnitTestAssert.ThrowsException(() => System.IO.File.Copy(srcFile.FullName, dstFile.FullName)); 31 | 32 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.File.Copy(srcFile.FullName, dstFile.FullName)); 33 | 34 | 35 | Alphaleonis.Win32.Filesystem.File.Copy(srcFile.FullName, dstFile.FullName, true); 36 | 37 | 38 | Assert.IsTrue(System.IO.File.Exists(srcFile.FullName), "The file does not exists, but is expected to."); 39 | 40 | Assert.IsTrue(System.IO.File.Exists(dstFile.FullName), "The file does not exists, but is expected to."); 41 | } 42 | 43 | Console.WriteLine(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File.Copy/File.Copy_EmptyDestFileNameAsPath_ThrowsArgumentException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class CopyTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void File_Copy_EmptyDestFileNameAsPath_ThrowsArgumentException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.File.Copy("source.txt", string.Empty)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File.Copy/File.Copy_NullDestFileNameAsPath_ThrowsArgumentNullException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class CopyTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void File_Copy_NullDestFileNameAsPath_ThrowsArgumentNullException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.File.Copy("source.txt", null)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File.Copy/File.Copy_NullSourceFileNameAsPath_ThrowsArgumentNullException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class CopyTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void File_Copy_NullSourceFileNameAsPath_ThrowsArgumentNullException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.File.Copy(null, "destination.txt")); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File.Delete/File.Delete_EmptyAsPath_ThrowsArgumentException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class DeleteTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void File_Delete_EmptyAsPath_ThrowsArgumentException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.File.Delete(string.Empty)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File.Delete/File.Delete_NullAsPath_ThrowsArgumentNullException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class DeleteTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void File_Delete_NullAsPath_ThrowsArgumentNullException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.File.Delete(null)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File.Move/File.Move_EmptyDestFileNameAsPath_ThrowsArgumentException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class MoveTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void File_Move_EmptyDestFileNameAsPath_ThrowsArgumentException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.File.Move("source.txt", string.Empty)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File.Move/File.Move_EmptySourceFileNameAsPath_ThrowsArgumentException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class MoveTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void File_Move_EmptySourceFileNameAsPath_ThrowsArgumentException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.File.Move(string.Empty, "destination.txt")); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File.Move/File.Move_NullDestFileNameAsPath_ThrowsArgumentNullException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class MoveTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void File_Move_NullDestFileNameAsPath_ThrowsArgumentNullException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.File.Move("source.txt", null)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File.Move/File.Move_NullSourceFileNameAsPath_ThrowsArgumentNullException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// This is a test class for Directory and is intended to contain all CreateDirectory Unit Tests. 28 | public partial class MoveTest 29 | { 30 | // Pattern: ___ 31 | 32 | 33 | [TestMethod] 34 | public void File_Move_NullSourceFileNameAsPath_ThrowsArgumentNullException_Success() 35 | { 36 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.File.Move(null, "destination.txt")); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/FileTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all File class Unit Tests. 27 | [TestClass] 28 | public partial class FileTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File_Append/File.AppendTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for File and is intended to contain all Append Unit Tests. 27 | [TestClass] 28 | public partial class File_AppendTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/File Class/File_Create/File.CreateTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for File and is intended to contain all Create Unit Tests. 27 | [TestClass] 28 | public partial class File_CreateTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/FileInfo Class/FileInfoTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all FileInfo class Unit Tests. 27 | [TestClass] 28 | public partial class FileInfoTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Path Class/Path.GetExtension/Path.GetExtension_NullOrEmpty.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for Path and is intended to contain all Path Unit Tests. 27 | public partial class PathTest 28 | { 29 | // Pattern: ___ 30 | 31 | 32 | [TestMethod] 33 | public void Path_GetExtension_NullOrEmpty_Success() 34 | { 35 | Assert.AreEqual(System.IO.Path.GetExtension(null), Alphaleonis.Win32.Filesystem.Path.GetExtension(null)); 36 | 37 | Assert.AreEqual(System.IO.Path.GetExtension(string.Empty), Alphaleonis.Win32.Filesystem.Path.GetExtension(string.Empty)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Path Class/Path.GetFileName/Path.GetFileName_NullOrEmpty.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | public partial class PathTest 27 | { 28 | // Pattern: ___ 29 | 30 | 31 | [TestMethod] 32 | public void Path_GetFileName_NullOrEmpty_Success() 33 | { 34 | Assert.AreEqual(System.IO.Path.GetFileName(null), Alphaleonis.Win32.Filesystem.Path.GetFileName(null)); 35 | 36 | Assert.AreEqual(System.IO.Path.GetFileName(string.Empty), Alphaleonis.Win32.Filesystem.Path.GetFileName(string.Empty)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Path Class/Path.GetFileNameWithoutExtension/Path.GetFileNameWithoutExtension_NullOrEmpty.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | public partial class PathTest 27 | { 28 | // Pattern: ___ 29 | 30 | 31 | [TestMethod] 32 | public void Path_GetFileNameWithoutExtension_NullOrEmpty_Success() 33 | { 34 | Assert.AreEqual(System.IO.Path.GetFileNameWithoutExtension(null), Alphaleonis.Win32.Filesystem.Path.GetFileNameWithoutExtension(null)); 35 | 36 | Assert.AreEqual(System.IO.Path.GetFileNameWithoutExtension(string.Empty), Alphaleonis.Win32.Filesystem.Path.GetFileNameWithoutExtension(string.Empty)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Path Class/Path.GetPathRoot/Path.GetPathRoot_ThrowArgumentExceptionEmptyString.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | using Microsoft.VisualStudio.TestTools.UnitTesting; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | public partial class PathTest 28 | { 29 | // Pattern: ___ 30 | 31 | 32 | [TestMethod] 33 | public void Path_GetPathRoot_ThrowsArgumentExceptionEmptyString_Success() 34 | { 35 | UnitTestConstants.PrintUnitTestHeader(false); 36 | 37 | UnitTestAssert.ThrowsException(() => System.IO.Path.GetPathRoot(string.Empty)); 38 | 39 | UnitTestAssert.ThrowsException(() => Alphaleonis.Win32.Filesystem.Path.GetPathRoot(string.Empty)); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Path Class/Path.IsPathRooted/Path.IsPathRooted_NullOrEmpty.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for Path and is intended to contain all Path Unit Tests. 27 | public partial class PathTest 28 | { 29 | // Pattern: ___ 30 | 31 | 32 | [TestMethod] 33 | public void Path_IsPathRooted_NullOrEmpty_Success() 34 | { 35 | Assert.AreEqual(System.IO.Path.IsPathRooted(null), Alphaleonis.Win32.Filesystem.Path.IsPathRooted(null)); 36 | 37 | Assert.AreEqual(System.IO.Path.IsPathRooted(string.Empty), Alphaleonis.Win32.Filesystem.Path.IsPathRooted(string.Empty)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Path Class/PathTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Path class Unit Tests. 27 | [TestClass] 28 | public partial class PathTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | using System.Reflection; 22 | using System.Runtime.InteropServices; 23 | 24 | 25 | [assembly: AssemblyCulture("")] 26 | 27 | [assembly: ComVisible(false)] 28 | 29 | [assembly: Guid("36438038-577d-4da6-9cb8-7cbed3773df4")] 30 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/UnitTest Utility/PrintUnitTestHeader.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// Containts static variables, used by unit tests. 27 | public static partial class UnitTestConstants 28 | { 29 | public static void PrintUnitTestHeader(bool? isNetwork = null) 30 | { 31 | if (null == isNetwork) 32 | Console.WriteLine("\n=== TEST LOCAL / NETWORK ==="); 33 | 34 | else 35 | Console.WriteLine("\n=== TEST {0} ===", (bool) isNetwork ? "NETWORK" : "LOCAL"); 36 | 37 | 38 | Console.WriteLine(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/UnitTest Utility/StringToByteArray.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace AlphaFS.UnitTest 26 | { 27 | /// Containts static variables, used by unit tests. 28 | public static partial class UnitTestConstants 29 | { 30 | public static byte[] StringToByteArray(string str, params Encoding[] encoding) 31 | { 32 | var encode = encoding != null && encoding.Any() ? encoding[0] : new UTF8Encoding(true, true); 33 | 34 | return encode.GetBytes(str); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/UnitTests/AccessControlTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all AccessControl Unit Tests. 27 | [TestClass] 28 | public partial class AccessControlTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/UnitTests/CopyTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Copy Unit Tests. 27 | 28 | [TestClass] 29 | public partial class CopyTest 30 | { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/UnitTests/DeleteTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Delete Unit Tests. 27 | [TestClass] 28 | public partial class DeleteTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/UnitTests/EnumerationTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Enumeration Unit Tests. 27 | [TestClass] 28 | public partial class EnumerationTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/UnitTests/ExistsTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Exists Unit Tests. 27 | [TestClass] 28 | public partial class ExistsTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/UnitTests/MoveTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Move Unit Tests. 27 | [TestClass] 28 | public partial class MoveTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/UnitTests/SizeTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Size Unit Tests. 27 | [TestClass] 28 | public partial class SizeTest 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/AlphaFS.UnitTest/UnitTests/TimestampsTest.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | * THE SOFTWARE. 20 | */ 21 | 22 | using Microsoft.VisualStudio.TestTools.UnitTesting; 23 | 24 | namespace AlphaFS.UnitTest 25 | { 26 | /// This is a test class for all Timestamps Unit Tests. 27 | [TestClass] 28 | public partial class TimestampsTest 29 | { 30 | } 31 | } 32 | --------------------------------------------------------------------------------