Purity User File Create Error Rating: 10,0/10 5599 reviews
-->

Definition

I want to create a directory if it doesn't exists after login to sftp server. Test.sh sftp name@example.com.

Overloads

Create(String)Create(String)Create(String)Create(String)

Creates or overwrites a file in the specified path.

Create(String, Int32)Create(String, Int32)Create(String, Int32)Create(String, Int32)

Creates or overwrites the specified file.

Create(String, Int32, FileOptions)Create(String, Int32, FileOptions)Create(String, Int32, FileOptions)Create(String, Int32, FileOptions)

Creates or overwrites the specified file, specifying a buffer size and a FileOptions value that describes how to create or overwrite the file.

Create(String, Int32, FileOptions, FileSecurity)Create(String, Int32, FileOptions, FileSecurity)Create(String, Int32, FileOptions, FileSecurity)

Creates or overwrites the specified file with the specified buffer size, file options, and file security.

Create(String)Create(String)Create(String)Create(String)

Creates or overwrites a file in the specified path.

Parameters

path
StringStringStringString

The path and name of the file to create.

Returns

A FileStream that provides read/write access to the file specified in path.

Exceptions

UnauthorizedAccessExceptionUnauthorizedAccessExceptionUnauthorizedAccessExceptionUnauthorizedAccessException

The caller does not have the required permission.

-or-

path specified a file that is read-only.

-or-

path specified a file that is hidden.

ArgumentExceptionArgumentExceptionArgumentExceptionArgumentException

path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by InvalidPathChars.

ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionArgumentNullException

path is null.

PathTooLongExceptionPathTooLongExceptionPathTooLongExceptionPathTooLongException

The specified path, file name, or both exceed the system-defined maximum length.

Purity User File Create Error In Excel

DirectoryNotFoundExceptionDirectoryNotFoundExceptionDirectoryNotFoundExceptionDirectoryNotFoundException

The specified path is invalid (for example, it is on an unmapped drive).

An I/O error occurred while creating the file.

NotSupportedExceptionNotSupportedExceptionNotSupportedExceptionNotSupportedException

path is in an invalid format.

Examples

The following example creates a file in the specified path, writes some information to the file, and reads from the file.

Remarks

The FileStream object created by this method has a default FileShare value of None; no other process or code can access the created file until the original file handle is closed.

This method is equivalent to the Create(String, Int32) method overload using the default buffer size of 4,096 bytes.

The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.

If the specified file does not exist, it is created; if it does exist and it is not read-only, the contents are overwritten.

By default, full read/write access to new files is granted to all users. The file is opened with read/write access and must be closed before it can be opened by another application.

For a list of common I/O tasks, see Common I/O Tasks.

Security

FileIOPermission
for permission to read and write to the file described by the path parameter. Security action: Demand . Associated enumerations: Read, Write

See also

Create(String, Int32)Create(String, Int32)Create(String, Int32)Create(String, Int32)

Creates or overwrites the specified file.

Parameters

bufferSize
Int32Int32Int32Int32

The number of bytes buffered for reads and writes to the file.

Returns

A FileStream with the specified buffer size that provides read/write access to the file specified in path.

Exceptions

UnauthorizedAccessExceptionUnauthorizedAccessExceptionUnauthorizedAccessExceptionUnauthorizedAccessException

The caller does not have the required permission.

-or-

path specified a file that is read-only.

-or-

path specified a file that is hidden.

ArgumentExceptionArgumentExceptionArgumentExceptionArgumentException

path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by InvalidPathChars.

ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionArgumentNullException

path is null.

PathTooLongExceptionPathTooLongExceptionPathTooLongExceptionPathTooLongException

The specified path, file name, or both exceed the system-defined maximum length.

DirectoryNotFoundExceptionDirectoryNotFoundExceptionDirectoryNotFoundExceptionDirectoryNotFoundException

The specified path is invalid (for example, it is on an unmapped drive).

An I/O error occurred while creating the file.

NotSupportedExceptionNotSupportedExceptionNotSupportedExceptionNotSupportedException

path is in an invalid format.

Examples

Purity User File Create Error

The following example creates a file with the specified buffer size.

Remarks

The FileStream object created by this method has a default FileShare value of None; no other process or code can access the created file until the original file handle is closed.

The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.

This method is equivalent to the FileStream(String, FileMode, FileAccess, FileShare, Int32) constructor overload. If the specified file does not exist, it is created; if it does exist and it is not read-only, the contents are overwritten.

By default, full read/write access to new files is granted to all users. The file is opened with read/write access and must be closed before it can be opened by another application.

For a list of common I/O tasks, see Common I/O Tasks.

Security

FileIOPermission
for permission to read and write to the file described by the path parameter. Security action: Demand. Associated enumerations: Read, Write

See also

Create(String, Int32, FileOptions)Create(String, Int32, FileOptions)Create(String, Int32, FileOptions)Create(String, Int32, FileOptions)

Creates or overwrites the specified file, specifying a buffer size and a FileOptions value that describes how to create or overwrite the file.

Parameters

bufferSize
Int32Int32Int32Int32

The number of bytes buffered for reads and writes to the file.

options
FileOptionsFileOptionsFileOptionsFileOptions

One of the FileOptions values that describes how to create or overwrite the file.

Returns

A new file with the specified buffer size.

Exceptions

UnauthorizedAccessExceptionUnauthorizedAccessExceptionUnauthorizedAccessExceptionUnauthorizedAccessException

The caller does not have the required permission.

-or-

path specified a file that is read-only.

-or-

path specified a file that is hidden.

ArgumentExceptionArgumentExceptionArgumentExceptionArgumentException

path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by InvalidPathChars.

ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionArgumentNullException

path is null.

PathTooLongExceptionPathTooLongExceptionPathTooLongExceptionPathTooLongException

The specified path, file name, or both exceed the system-defined maximum length.

DirectoryNotFoundExceptionDirectoryNotFoundExceptionDirectoryNotFoundExceptionDirectoryNotFoundException

The specified path is invalid (for example, it is on an unmapped drive.

An I/O error occurred while creating the file.

NotSupportedExceptionNotSupportedExceptionNotSupportedExceptionNotSupportedException

path is in an invalid format.

Remarks

The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.

This method is equivalent to the FileStream(String, FileMode, FileAccess, FileShare, Int32) constructor overload. If the specified file does not exist, it is created; if it does exist and it is not read-only, the contents are overwritten.

By default, full read/write access to new files is granted to all users. The file is opened with read/write access and must be closed before it can be opened by another application.

For a list of common I/O tasks, see Common I/O Tasks.

Security

FileIOPermission
for permission to read and write to the file described by the path parameter. Security action: Demand. Associated enumerations: Read, Write

Create(String, Int32, FileOptions, FileSecurity)Create(String, Int32, FileOptions, FileSecurity)Create(String, Int32, FileOptions, FileSecurity)

Creates or overwrites the specified file with the specified buffer size, file options, and file security.

Parameters

bufferSize
Int32Int32Int32Int32

The number of bytes buffered for reads and writes to the file.

options
FileOptionsFileOptionsFileOptionsFileOptions
Purity User File Create Error

One of the FileOptions values that describes how to create or overwrite the file.

fileSecurity
FileSecurityFileSecurityFileSecurityFileSecurity

One of the FileSecurity values that determines the access control and audit security for the file.

Returns

A new file with the specified buffer size, file options, and file security.

Create

Exceptions

UnauthorizedAccessExceptionUnauthorizedAccessExceptionUnauthorizedAccessExceptionUnauthorizedAccessException

The caller does not have the required permission.

-or-

path specified a file that is read-only.

-or-

path specified a file that is hidden.

ArgumentExceptionArgumentExceptionArgumentExceptionArgumentException

path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by InvalidPathChars.

ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionArgumentNullException

path is null.

PathTooLongExceptionPathTooLongExceptionPathTooLongExceptionPathTooLongException

The specified path, file name, or both exceed the system-defined maximum length.

DirectoryNotFoundExceptionDirectoryNotFoundExceptionDirectoryNotFoundExceptionDirectoryNotFoundException

The specified path is invalid (for example, it is on an unmapped drive).

An I/O error occurred while creating the file.

NotSupportedExceptionNotSupportedExceptionNotSupportedExceptionNotSupportedException

path is in an invalid format.

Remarks

The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.

This method is equivalent to the FileStream(String, FileMode, FileAccess, FileShare, Int32) constructor overload. If the specified file does not exist, it is created; if it does exist and it is not read-only, the contents are overwritten.

By default, full read/write access to new files is granted to all users. The file is opened with read/write access and must be closed before it can be opened by another application.

For a list of common I/O tasks, see Common I/O Tasks.

Security

FileIOPermission
for permission to read and write to the file described by the path parameter. Security action: Demand. Associated enumerations: Read, Write

Applies to