.Net Runtime Library for Delphi
Close
Common I/O Tasks

The CNCrLib.IO and CNCrLib.Core orCNCrLib.Core.Intf namespaces provide several interfaces that allow for various actions, such as reading and writing, to be performed on files, directories, and streams.

To do this...

See the example in this topic...

Create a text file

_File.CreateText method

_FileInfo.CreateText method

_File.Create method

_FileInfo.Create method

Write to a text file

How to: Write Text to a File

Read from a text file

How to: Read Text from a File

Append text to a file

How to: Open and Append to a Log File

_File.AppendText method

_FileInfo.AppendText method

Rename or move a file

_File.Move method

_FileInfo.MoveTo method

Delete a file

_File.Delete method

_FileInfo.Delete method

Copy a file

_File.Copy method

_FileInfo.CopyTo method

Get the size of a file

_FileInfo.Length property

Get the attributes of a file

_File.GetAttributes method

Set the attributes of a file

_File.SetAttributes method

Determine whether a file exists

_File.Exists method

Read from a binary file

How to: Read and Write to a Newly Created Data File

Write to a binary file

How to: Read and Write to a Newly Created Data File

Retrieve a file name extension

_Path.GetExtension method

Retrieve the fully qualified path of a file

_Path.GetFullPath method

Retrieve the file name and extension from a path

_Path.GetFileName method

Change the extension of a file

_Path.ChangeExtension method

To do this...

See the example in this topic...

Access a file in a special folder such as My Documents

How to: Write Text to a File

Create a directory

_Directory.CreateDirectory method

_FileInfo.Directory property

Create a subdirectory

_DirectoryInfo.CreateSubdirectory method

Rename or move a directory

_Directory.Move method

_DirectoryInfo.MoveTo method

Copy a directory

How to: Copy Directories

Delete a directory

_Directory.Delete method

_DirectoryInfo.Delete method

See the files and subdirectories in a directory

How to: Enumerate Directories and Files

Find the size of a directory

CNClrLib.Core._Directory or CNClrLib.Core.Intf._Directory Interface

Determine whether a directory exists

_Directory.Exists method