Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Sep 25, 2024
1 parent 3d7d71b commit ac8ae5e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ endif()

project(ffilesystem
LANGUAGES C
VERSION 5.7.2
VERSION 5.8.0
)

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.30.0 AND CMAKE_VERSION VERSION_LESS 3.30.4)
Expand Down
2 changes: 1 addition & 1 deletion fpm.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ffilesystem"
description = "Lightweight filesystem and path manipulations"
categories = "io"
version = "5.7.2"
version = "5.8.0"

[build]
auto-examples = false
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('ffilesystem', ['c'],
version: '5.7.2',
version: '5.8.0',
default_options: ['c_std=c99', 'cpp_std=c++23,c++20,c++17', 'buildtype=release', 'b_ndebug=if-release'],
meson_version : '>=1.4.0')

Expand Down
5 changes: 2 additions & 3 deletions src/c/resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
size_t fs_canonical(const char* path, const bool strict, const bool expand_tilde,
char* result, const size_t buffer_size)
{
// distinct from resolve()

// distinct from resolve
// canonicalize path, i.e. resolve all symbolic links, remove ".", ".." and extra slashes
const size_t L = strlen(path);
if(L == 0)
return 0;
Expand Down Expand Up @@ -85,6 +83,7 @@ bool fs_equivalent(const char* path1, const char* path2)
size_t fs_absolute(const char* path, const char* base, const bool expand_tilde,
char* result, const size_t buffer_size)
{
// works mostly like Python pathlib.Path.absolute()

char* ex = (char*) malloc(buffer_size);
if(!ex) return 0;
Expand Down
2 changes: 2 additions & 0 deletions src/common/resolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ std::optional<std::string> Ffs::canonical(std::string_view path, const bool stri
std::string Ffs::absolute(std::string_view path, const bool expand_tilde)
{
// wraps std::filesystem::absolute(path).
// path need not exist
// Inspired by Python pathlib.Path.absolute()
// https://docs.python.org/3/library/pathlib.html#pathlib.Path.absolute

Expand All @@ -66,6 +67,7 @@ std::string Ffs::absolute(std::string_view path, const bool expand_tilde)

std::string Ffs::absolute(std::string_view path, std::string_view base, const bool expand_tilde)
{
// variant that allow rebasing on base path
const auto ex = expand_tilde
? std::filesystem::path(Ffs::expanduser(path))
: path;
Expand Down

0 comments on commit ac8ae5e

Please sign in to comment.