Click or drag to resize

FileExistsTransacted Method (KernelTransaction, String, PathFormat)

[AlphaFS] Determines whether the specified file exists.

Namespace:  Alphaleonis.Win32.Filesystem
Assembly:  AlphaFS (in AlphaFS.dll) Version: 2.0
public static bool ExistsTransacted(
	KernelTransaction transaction,
	string path,
	PathFormat pathFormat


Type: Alphaleonis.Win32.FilesystemKernelTransaction
The transaction.
Type: SystemString
The file to check.
Type: Alphaleonis.Win32.FilesystemPathFormat
Indicates the format of the path parameter(s).

Return Value

Type: Boolean

Returns if the caller has the required permissions

and path contains the name of an existing file; otherwise,


MSDN: .NET 3.5+: Trailing spaces are removed from the end of the path parameter before checking whether the directory exists.

The Exists method returns if any error occurs while trying to determine if the specified file exists.

This can occur in situations that raise exceptions such as passing a file name with invalid characters or too many characters,

a failing or missing disk, or if the caller does not have permission to read the file.

The Exists method should not be used for path validation,

this method merely checks if the file specified in path exists.

Passing an invalid path to Exists returns false.

Be aware that another process can potentially do something with the file in between

the time you call the Exists method and perform another operation on the file, such as Delete.

See Also