Common I/O Tasks
The xtd.io namespace provides several classes that allow for various actions, such as reading and writing, to be performed on files, directories, and streams. For more information, see File and Stream I/O.
Preamble
Prefer in your application to use the Input/output library and Filesystem library of the std.
xtd has its own IO API because the Filesystem library doesn't work on all OS (like for example iOS).
Some features exist only in the xtd API like binary reader/writer, stream reader/writer, string reader/writer and text reader/writer.
Common File Tasks
To do this...
Create a text file
Write to a text file
Read from a text file
Append text to a file
Rename or move a file
Delete a file
Copy a file
Get the size of a file
Get the attributes of a file
Set the attributes of a file
Determine whether a file exists
Read from a binary file
Write to a binary file
Retrieve a file name extension
Retrieve the fully qualified path of a file
Retrieve the file name and extension from a path
Change the extension of a file
See the example in this topic...
xtd::io::file::create_text method
xtd::io::file_info::create_text method
xtd::io::file::create method
xtd::io::file_info::create method
xtd::io::file::move method
xtd::io::file_info::move_to method
xtd::io::file::remove method
xtd::io::file_info::remove method
xtd::io::file::copy method
xtd::io::file_info::copy_to method
xtd::io::file_info::length property
xtd::io::file::exists method
xtd::io::path::get_extension method
xtd::io::path::get_full_path method
xtd::io::path::get_file_name method
Common Directory Tasks
To do this...
Access a file in a special folder such as My Documents
Create a directory
Create a subdirectory
Rename or move a directory
Copy a directory
Delete a directory
See the files and subdirectories in a directory
Find the size of a directory
Determine whether a directory exists
See the example in this topic...
xtd::io::directory::create_directory method
xtd::io::file_info::directory property
xtd::io::directory::move method
xtd::io::directory_info::move_to method
xtd::io::directory::exists method