Skip to content

Replace csync C code with std::filesystem - #393

Merged
TheOneRing merged 2 commits into
mainfrom
work/csync
Jul 22, 2025
Merged

TheOneRing merged 2 commits into
mainfrom
work/csync

Conversation

@TheOneRing

Copy link
Copy Markdown
Contributor

No description provided.

@TheOneRing
TheOneRing force-pushed the work/csync branch 15 times, most recently from 1ccf1f3 to 14042a8 Compare July 22, 2025 12:34
@TheOneRing
TheOneRing requested a review from Copilot July 22, 2025 13:39
@TheOneRing
TheOneRing marked this pull request as ready for review July 22, 2025 13:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the legacy csync C code with modern C++ std::filesystem APIs for directory traversal and file metadata operations. The main goal is to modernize the codebase by removing platform-specific C code and using standard library facilities.

Key changes include:

  • Removes the entire csync VIO (Virtual I/O) layer and replaces it with std::filesystem directory iteration
  • Introduces new LocalInfo class to encapsulate file metadata with proper filesystem handling
  • Updates VFS interface to use std::filesystem::directory_entry instead of csync_file_stat_t
  • Migrates file operation functions (getModTime, setModTime, getSize, getInode) to use std::filesystem

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/libsync/vio/* Removes legacy csync VIO implementation files entirely
src/libsync/discoveryinfo.* Adds new LocalInfo class with std::filesystem-based metadata handling
src/libsync/filesystem.* Updates file system utilities to use std::filesystem APIs
src/libsync/discoveryphase.cpp Replaces csync directory iteration with std::filesystem::directory_iterator
src/plugins/vfs//vfs_.* Updates VFS interface to use new LocalInfo-based statTypeVirtualFile method
test/* Updates tests to use new filesystem APIs and removes csync dependencies
Comments suppressed due to low confidence (1)

src/libsync/filesystem.cpp:63

  • Return type should be 'bool' not 'time_t' to match the actual setModTime function signature
    while (!f1.atEnd()) {

Comment thread test/testutility.cpp Resolved
Comment thread src/libsync/filesystem.cpp Resolved
Comment thread src/libsync/filesystem.cpp Resolved
Comment thread src/libsync/discoveryinfo.cpp Resolved
@TheOneRing
TheOneRing merged commit 5ff6f56 into main Jul 22, 2025
@TheOneRing
TheOneRing deleted the work/csync branch July 22, 2025 15:16
@openclouders openclouders mentioned this pull request Jul 22, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants