Skip to content

Commit

Permalink
Document behaviour of exists_on_disk for dir segments. refs: #279
Browse files Browse the repository at this point in the history
  • Loading branch information
spanezz committed Nov 22, 2021
1 parent 588f466 commit 5ea83f8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arki/segment/dir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,13 @@ void HoleWriter::write_file(Metadata& md, NamedFileDescriptor& fd)
template<typename Segment>
bool BaseChecker<Segment>::exists_on_disk()
{
/**
* To consider the segment an existing dir segment, it needs to be a
* directory that contains a .sequence file.
*
* Just an empty directory is considered not enough, to leave space for
* implementing different formats of directory-based segments
*/
if (!sys::isdir(this->segment().abspath)) return false;
return sys::exists(str::joinpath(this->segment().abspath, ".sequence"));
}
Expand Down

0 comments on commit 5ea83f8

Please sign in to comment.