[#fs-path]
= xref:fs.adoc[fs]::path
:relfileprefix: ../
:mrdocs:

Path class wrapper to block calls to the fs&colon;&colon;path(std&colon;&colon;string) implicit constructor and the fs&colon;&colon;path&colon;&colon;string() method, which have unsafe and unpredictable behavior on Windows (see implementation note in PathToString for details)

== Synopsis

Declared in `&lt;util&sol;fs&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class path
    : public std::filesystem::path
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `std::filesystem::path`
| 
|===

== Types

[cols="1"]
|===
| Name
| xref:fs/path/iterator.adoc[`iterator`] 
|===


== Type Aliases

[cols="1"]
|===
| Name
| xref:fs/path/__string_view.adoc[`&lowbar;&lowbar;string&lowbar;view`] 
| xref:fs/path/const_iterator.adoc[`const&lowbar;iterator`] 
| xref:fs/path/string_type.adoc[`string&lowbar;type`] 
| xref:fs/path/value_type.adoc[`value&lowbar;type`] 
|===


== Enums

[cols="1"]
|===
| Name
| xref:fs/path/format.adoc[`format`] 
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:fs/path/2constructor-066.adoc[`path`]         [.small]#[constructor]#
| Constructors
| xref:fs/path/operator_assign-0b.adoc[`operator&equals;`] 
| Assignment operators
| xref:fs/path/__reserve.adoc[`&lowbar;&lowbar;reserve`] 
| 
| xref:fs/path/append-09.adoc[`append`] 
| `append` overloads
| xref:fs/path/assign-03.adoc[`assign`] 
| 
| xref:fs/path/begin.adoc[`begin`] 
| 
| xref:fs/path/c_str.adoc[`c&lowbar;str`] 
| 
| xref:fs/path/clear.adoc[`clear`] 
| 
| xref:fs/path/compare-00.adoc[`compare`] 
| 
| xref:fs/path/concat-08.adoc[`concat`] 
| 
| xref:fs/path/empty.adoc[`empty`] 
| 
| xref:fs/path/end.adoc[`end`] 
| 
| xref:fs/path/extension.adoc[`extension`] 
| 
| xref:fs/path/filename.adoc[`filename`] 
| 
| xref:fs/path/generic_string-04.adoc[`generic&lowbar;string`] 
| 
| xref:fs/path/generic_u16string.adoc[`generic&lowbar;u16string`] 
| 
| xref:fs/path/generic_u32string.adoc[`generic&lowbar;u32string`] 
| 
| xref:fs/path/generic_u8string.adoc[`generic&lowbar;u8string`] 
| 
| xref:fs/path/generic_wstring.adoc[`generic&lowbar;wstring`] 
| 
| xref:fs/path/has_extension.adoc[`has&lowbar;extension`] 
| 
| xref:fs/path/has_filename.adoc[`has&lowbar;filename`] 
| 
| xref:fs/path/has_parent_path.adoc[`has&lowbar;parent&lowbar;path`] 
| 
| xref:fs/path/has_relative_path.adoc[`has&lowbar;relative&lowbar;path`] 
| 
| xref:fs/path/has_root_directory.adoc[`has&lowbar;root&lowbar;directory`] 
| 
| xref:fs/path/has_root_name.adoc[`has&lowbar;root&lowbar;name`] 
| 
| xref:fs/path/has_root_path.adoc[`has&lowbar;root&lowbar;path`] 
| 
| xref:fs/path/has_stem.adoc[`has&lowbar;stem`] 
| 
| xref:fs/path/is_absolute.adoc[`is&lowbar;absolute`] 
| 
| xref:fs/path/is_relative.adoc[`is&lowbar;relative`] 
| 
| xref:fs/path/lexically_normal.adoc[`lexically&lowbar;normal`] 
| 
| xref:fs/path/lexically_proximate.adoc[`lexically&lowbar;proximate`] 
| 
| xref:fs/path/lexically_relative.adoc[`lexically&lowbar;relative`] 
| 
| xref:fs/path/make_preferred.adoc[`make&lowbar;preferred`] 
| 
| xref:fs/path/native.adoc[`native`] 
| 
| xref:fs/path/operator_plus_eq-0c.adoc[`operator&plus;&equals;`] 
| Addition assignment operators
| xref:fs/path/operator_slash_eq-0c.adoc[`operator&sol;&equals;`] 
| Division assignment operators
| xref:fs/path/parent_path.adoc[`parent&lowbar;path`] 
| 
| xref:fs/path/relative_path.adoc[`relative&lowbar;path`] 
| 
| xref:fs/path/remove_filename.adoc[`remove&lowbar;filename`] 
| 
| xref:fs/path/replace_extension.adoc[`replace&lowbar;extension`] 
| 
| xref:fs/path/replace_filename.adoc[`replace&lowbar;filename`] 
| 
| xref:fs/path/root_directory.adoc[`root&lowbar;directory`] 
| 
| xref:fs/path/root_name.adoc[`root&lowbar;name`] 
| 
| xref:fs/path/root_path.adoc[`root&lowbar;path`] 
| 
| xref:fs/path/std_path-04.adoc[`std&lowbar;path`] 
| `std&lowbar;path` overloads
| xref:fs/path/stem.adoc[`stem`] 
| 
| xref:fs/path/string-0e.adoc[`string`] 
| Deleted to forbid std&colon;&colon;string conversion, which encodes locale&hyphen;dependently on Windows&period;
| xref:fs/path/swap.adoc[`swap`] 
| 
| xref:fs/path/u16string.adoc[`u16string`] 
| 
| xref:fs/path/u32string.adoc[`u32string`] 
| 
| xref:fs/path/u8string.adoc[`u8string`] 
| 
| xref:fs/path/utf8string.adoc[`utf8string`] 
| Return a UTF&hyphen;8 representation of the path as a std&colon;&colon;string, for compatibility with code using std&colon;&colon;string&period; For code using the newer std&colon;&colon;u8string type, it is more efficient to call the inherited std&colon;&colon;filesystem&colon;&colon;path&colon;&colon;u8string method instead&period;
| xref:fs/path/wstring.adoc[`wstring`] 
| 
| xref:fs/path/2conversion.adoc[`operator string&lowbar;type`]  [.small]#[deleted]#
| Deleted to forbid implicit string&lowbar;type conversion, whose type varies by platform and breaks portability&period;
|===


== Static Data Members

[cols="1"]
|===
| Name
| xref:fs/path/preferred_separator.adoc[`preferred&lowbar;separator`] 
|===


== Using Declarations

[cols="1,4"]
|===
| Name| Description
| xref:fs/path/path.adoc[`path`] 
| Inherit the std&colon;&colon;filesystem&colon;&colon;path constructors&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:fs/operator_plus.adoc[`operator&plus;`]
| Deleted catch&hyphen;all overload that forbids unsafe path concatenation via operator&plus;&period;
| xref:fs/operator_slash.adoc[`operator&sol;`]
| Deleted catch&hyphen;all overload that forbids unsafe path append operations via operator&sol;&period;
| xref:AbsPathForConfigVal.adoc[`&colon;&colon;AbsPathForConfigVal`]
| Most paths passed as configuration arguments are treated as relative to the datadir if they are not absolute&period;
| xref:BlockPolicyFeeEstPath.adoc[`&colon;&colon;BlockPolicyFeeEstPath`]
| Path of the block policy fee estimator data file&period;
| xref:CheckDiskSpace.adoc[`&colon;&colon;CheckDiskSpace`]
| Check that a directory has enough free space for an additional write&period;
| xref:DecodeAsmap.adoc[`&colon;&colon;DecodeAsmap`]
| Read and check asmap from provided binary file&period;
| xref:DirectoryCommit.adoc[`&colon;&colon;DirectoryCommit`]
| Sync directory contents&period; This is required on some environments to ensure that newly created files are committed to disk&period;
| xref:DumpAnchors.adoc[`&colon;&colon;DumpAnchors`]
| Dump the anchor IP address database (anchors&period;dat)
| xref:GetDefaultDataDir.adoc[`&colon;&colon;GetDefaultDataDir`]
| Get the default data directory for the current platform and user&period;
| xref:IsDirWritable.adoc[`&colon;&colon;IsDirWritable`]
| Check if a directory is writable by creating a temporary file on it&period;
| xref:MempoolPolicyEstimatorPath.adoc[`&colon;&colon;MempoolPolicyEstimatorPath`]
| Path of the mempool policy estimator data file&period;
| xref:ReadAnchors.adoc[`&colon;&colon;ReadAnchors`]
| Read the anchor IP address database (anchors&period;dat)
| xref:ReadBinaryFile.adoc[`&colon;&colon;ReadBinaryFile`]
| Read full contents of a file and return them in a std&colon;&colon;string&period;
| xref:RenameOver.adoc[`&colon;&colon;RenameOver`]
| Rename src to dest&period;
| xref:TryCreateDirectories.adoc[`&colon;&colon;TryCreateDirectories`]
| Create a directory and any missing parent directories&period;
| xref:UnlockDirectory.adoc[`&colon;&colon;UnlockDirectory`]
| Release a directory lock previously taken with LockDirectory&period;
| xref:WriteBinaryFile.adoc[`&colon;&colon;WriteBinaryFile`]
| Write contents of std&colon;&colon;string to a file&period;
| xref:common/ReadSettings.adoc[`&colon;&colon;common&colon;&colon;ReadSettings`]
| Read settings file&period;
| xref:common/WriteSettings.adoc[`&colon;&colon;common&colon;&colon;WriteSettings`]
| Write settings file&period;
| xref:fsbridge/AbsPathJoin.adoc[`&colon;&colon;fsbridge&colon;&colon;AbsPathJoin`]
| Helper function for joining two paths
| xref:fsbridge/fopen.adoc[`&colon;&colon;fsbridge&colon;&colon;fopen`]
| Open a file, handling path encoding correctly across platforms&period;
| xref:node/FindAssumeutxoChainstateDir.adoc[`&colon;&colon;node&colon;&colon;FindAssumeutxoChainstateDir`]
| Return a path to the snapshot&hyphen;based chainstate dir, if one exists&period;
| xref:node/MempoolPath.adoc[`&colon;&colon;node&colon;&colon;MempoolPath`]
| Return the on&hyphen;disk path used to load and save the persisted mempool&period;
| xref:node/ReadSnapshotBaseBlockhash.adoc[`&colon;&colon;node&colon;&colon;ReadSnapshotBaseBlockhash`]
| Read the blockhash of the snapshot base block that was used to construct the chainstate&period;
| xref:util/GetExePath.adoc[`&colon;&colon;util&colon;&colon;GetExePath`]
| Return path to current executable assuming it was invoked with argv0&period; If path could not be determined, returns an empty path&period;
| xref:util/LockDirectory.adoc[`&colon;&colon;util&colon;&colon;LockDirectory`]
| Acquire an exclusive lock on a directory via a lock file&period;
| xref:wallet/BDBDataFile.adoc[`&colon;&colon;wallet&colon;&colon;BDBDataFile`]
| Returns the path to the Berkeley DB data file for a wallet path&period;
| xref:wallet/GetWalletDir.adoc[`&colon;&colon;wallet&colon;&colon;GetWalletDir`]
| Get the path of the wallet directory&period;
| xref:wallet/GetWalletPath.adoc[`&colon;&colon;wallet&colon;&colon;GetWalletPath`]
| Determine the path that the wallet is stored in
| xref:wallet/IsBDBFile.adoc[`&colon;&colon;wallet&colon;&colon;IsBDBFile`]
| Returns whether the file at the path is a Berkeley DB file&period;
| xref:wallet/IsSQLiteFile.adoc[`&colon;&colon;wallet&colon;&colon;IsSQLiteFile`]
| Returns whether the file at the path is a SQLite file&period;
| xref:wallet/ListDatabases.adoc[`&colon;&colon;wallet&colon;&colon;ListDatabases`]
| Recursively list database paths in directory&period;
| xref:wallet/MakeBerkeleyRODatabase.adoc[`&colon;&colon;wallet&colon;&colon;MakeBerkeleyRODatabase`]
| Return object giving access to Berkeley Read Only database at specified path&period;
| xref:wallet/MakeDatabase.adoc[`&colon;&colon;wallet&colon;&colon;MakeDatabase`]
| Creates or opens a wallet database at the given path&period;
| xref:wallet/MakeSQLiteDatabase.adoc[`&colon;&colon;wallet&colon;&colon;MakeSQLiteDatabase`]
| Open or create a SQLite wallet database at the given path&period;
| xref:wallet/SQLiteDataFile.adoc[`&colon;&colon;wallet&colon;&colon;SQLiteDataFile`]
| Returns the path to the SQLite data file for a wallet path&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
