Lumiera  0.pre.03
»edit your freedom«
file.hpp File Reference

Go to the source code of this file.

Description

Includes the C++ Filesystem library and provides some convenience helpers.

The std::filesystem library allows for portable access to file and directory handling functions; this header maps these functions with an concise fs:: namespace prefix, and offers some convenience extensions, which are „slightly non-portable“ (meaning they were developed on Linux and „should“ work on Unix like systems; adapters for exotic operating systems could be added here when necessary...)

Todo:
3/2024 should be part of generic utilities

Definition in file file.hpp.

#include "lib/error.hpp"
#include "lib/symbol.hpp"
#include "lib/meta/util.hpp"
#include <filesystem>
#include <cstdlib>

Classes

struct  StringConv< fs::path, void >
 specialisation: render filesystem path as double quoted string More...
 

Functions

bool can_exec (fs::path const &p)
 
bool can_read (fs::path const &p)
 check if the owner has read permissions on the denoted file or directory
 
bool can_write (fs::path const &p)
 
fs::path consolidated (fs::path rawPath)
 resolves symlinks, ~ (Unix home dir) and relative specs More...
 
fs::path getHomePath ()
 
bool has_perm (fs::path const &p, fs::perms permissionMask)
 check if the denoted path p has at least the given permissions
 

Function Documentation

◆ consolidated()

fs::path std::filesystem::consolidated ( fs::path  rawPath)
inline

resolves symlinks, ~ (Unix home dir) and relative specs

Returns
absolute canonical form if the path exists; otherwise only the home directory is expanded

Definition at line 61 of file file.hpp.

References std::filesystem::consolidated().

Referenced by std::filesystem::consolidated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: