Xceed .NET Libraries Documentation
CreateFile(String,Boolean) Method


Xceed.FileSystem Assembly > Xceed.FileSystem Namespace > AbstractFolder Class > CreateFile Method : CreateFile(String,Boolean) Method
Relative name of the new file.
true if the new file should replace an existing file; false otherwise.
Creates a new file in the folder.
Syntax
'Declaration
 
Public Overloads Function CreateFile( _
   ByVal relativeName As String, _
   ByVal replaceIfExists As Boolean _
) As AbstractFile
'Usage
 
Dim instance As AbstractFolder
Dim relativeName As String
Dim replaceIfExists As Boolean
Dim value As AbstractFile
 
value = instance.CreateFile(relativeName, replaceIfExists)
public AbstractFile CreateFile( 
   string relativeName,
   bool replaceIfExists
)

Parameters

relativeName
Relative name of the new file.
replaceIfExists
true if the new file should replace an existing file; false otherwise.

Return Value

An AbstractFile object representing the newly created file.
Remarks

The relativeName parameter can include relative path information, in which ".." means "previous folder". For example: "folder/file.txt", "../file.txt", etc.

If a file named relativeName already exist in the destination folder and replaceIfExists is false, an exception is thrown. If replaceIfExists is true, the existing file is replaced by the newly created one.

If the physical folder in which the new file is to be created does not exist, it is created.

The current property values (such as FileSystemItem.Attributes) are applied to the newly created file.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AbstractFolder Class
AbstractFolder Members
Overload List