xtd 0.2.0
Loading...
Searching...
No Matches

◆ creation_time() [1/2]

const xtd::date_time & xtd::io::file_system_info::creation_time ( ) const

Gets the creation time of the current file or directory.

Returns
The creation date and time of the current xtd::io::file_system_info object.
Exceptions
xtd::io::io_exceptionsystem error when retrieving the file information.
xtd::io::directory_not_found_exceptionThe specified path is invalid; for example, it is on an unmapped drive.
xtd::platform_not_supported_exceptionThe opration is not supported on the current operating system.
Examples
The following example demonstrates the xtd::io::file_system_info::creation_time property. This code example is part of a larger example provided for the xtd::io::file_system_info class.
static void display_file_system_info_attributes(const file_system_info& fsi) {
// Assume that this entry is a file.
string entry_type = "File";
// Determine if entry is really a directory
entry_type = "Directory";
}
// Show this entry's type, name, and creation date.
console::write_line("{0} entry {1} was created on {2:D}", entry_type, fsi.full_name(), fsi.creation_time());
}
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
const xtd::date_time & creation_time() const
Gets the creation time of the current file or directory.
xtd::io::file_attributes attributes() const
Gets the attributes for the current file or directory.
xtd::string full_name() const
Gets the full path of the directory or file.
Provides the base class for both xtd::io::file_info and xtd::io::directory_info objects.
Definition file_system_info.h:87
@ directory
The file is a directory.
Examples
file_info2.cpp, and file_info_move_to.cpp.