Skip to content

Commit

Permalink
adding inode_type::symlink inode type reported by entrepot::read_dir_…
Browse files Browse the repository at this point in the history
…next_dirinfo() and inherited classes
  • Loading branch information
Edrusb committed Nov 29, 2024
1 parent 6e7d419 commit cd8cc7b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libdar/entrepot_aux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
namespace libdar
{

/// \addtogroup API
/// \addtogroup API
/// @{

/// type of inode
enum class inode_type { nondir, isdir, unknown };
enum class inode_type { nondir, symlink, isdir, unknown };


/// @}
Expand Down
2 changes: 2 additions & 0 deletions src/libdar/etage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ namespace libdar
fichier.push_back(cell(string(ret->d_name), inode_type::isdir));
break;
case DT_LNK:
fichier.push_back(cell(string(ret->d_name), inode_type::symlink));
break;
case DT_UNKNOWN:
fichier.push_back(cell(string(ret->d_name), inode_type::unknown));
break;
Expand Down
13 changes: 12 additions & 1 deletion src/libdar/i_entrepot_libcurl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,18 @@ namespace libdar
// chdir on symlink pointing to nondir inode will fail, but at least this stay an
// option, which would not be the case if we assume all symlinks not to point to
// directories: chdir to them would then be forbidden by entrepot_libcurl...
found->second = (line[0] == 'd' || line[0] == 'l') ? inode_type::isdir : inode_type::nondir;
switch(line[0])
{
case 'd':
found->second = inode_type::isdir;
break;
case 'l':
found->second = inode_type::symlink;
break;
default:
found->second = inode_type::nondir;
break;
}

// we now remove the best_entry from temporary_list to speed up future search

Expand Down

0 comments on commit cd8cc7b

Please sign in to comment.