GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::filesystem::filesystem_error::path1,std::filesystem::filesystem_error::path2(3) C++ Standard Libary std::filesystem::filesystem_error::path1,std::filesystem::filesystem_error::path2(3)

std::filesystem::filesystem_error::path1,std::filesystem::filesystem_error::path2 - std::filesystem::filesystem_error::path1,std::filesystem::filesystem_error::path2


const std::filesystem::path& path1() const noexcept; (since C++17)
const std::filesystem::path& path2() const noexcept; (since C++17)


Returns the paths that were stored in the exception object.


(none)


References to the copy of the path parameters stored by the constructor.

// Run this code


#include <cstdio>
#include <filesystem>
#include <iostream>


int main()
{
const std::filesystem::path old_p{std::tmpnam(nullptr)},
new_p{std::tmpnam(nullptr)};
try {
std::filesystem::rename(old_p, new_p); // throws since old_p does not exist
}
catch(std::filesystem::filesystem_error const& ex) {
std::cout
<< "what(): " << ex.what() << '\n'
<< "path1(): " << ex.path1() << '\n'
<< "path2(): " << ex.path2() << '\n';
}
}


what(): filesystem error: cannot rename: No such file or directory [/tmp/fileIzzRLB] [/tmp/fileiUDWlV]
path1(): "/tmp/fileIzzRLB"
path2(): "/tmp/fileiUDWlV"

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.