Moved files-auto find instead of mark them as Missing. Automatically detect where they were moved especially if its on the same volume. #15985

Closed
opened 2026-02-22 02:41:10 -05:00 by deekerman · 9 comments
Owner

Originally created by @ghost on GitHub (Aug 14, 2024).

Suggestion

Moved files-auto find instead of mark them as Missing. Automatically detect where they were moved especially if its on the same volume.

Use case

"Alignment."
Alignment to current Information+AI theories.
Auto-handle files.
Fool-proof seeding.
Intelligently manage torrent data coming and going to the system.
Reduce maintenance.
Provide a more human-friendly less mess-prone system to endusers.

Extra info/examples/attachments

win11 26120.14501 qbt 4.6.5 stable Qt: 6.4.3
Libtorrent: 2.0.11.0
Boost: 1.85.0
OpenSSL: 1.1.1w

Originally created by @ghost on GitHub (Aug 14, 2024). ### Suggestion Moved files-auto find instead of mark them as Missing. Automatically detect where they were moved especially if its on the same volume. ### Use case "Alignment." Alignment to current Information+AI theories. Auto-handle files. Fool-proof seeding. Intelligently manage torrent data coming and going to the system. Reduce maintenance. Provide a more human-friendly less mess-prone system to endusers. ### Extra info/examples/attachments win11 26120.14501 qbt 4.6.5 stable Qt: 6.4.3 Libtorrent: 2.0.11.0 Boost: 1.85.0 OpenSSL: 1.1.1w
deekerman 2026-02-22 02:41:10 -05:00
Author
Owner

@thalieht commented on GitHub (Aug 14, 2024):

Duplicate of #6520

@thalieht commented on GitHub (Aug 14, 2024): Duplicate of #6520
Author
Owner

@ghost commented on GitHub (Aug 14, 2024):

@thalieht thats not the same request that tool is for my other Feature Request that I raised

This one would be better done by NTFS ID tracking and USN Journal checking.

Or a more stupider directory traversal to match a directory name only should also be sufficient to satisfy this scenario.

To track where a directory has been moved on the same NTFS volume using the Win32 API, you can utilize the USN (Update Sequence Number) Journal or the ReadDirectoryChangesW function.

Using USN Journal

The USN Journal provides a record of changes made to files and directories on an NTFS volume. When a directory is moved, it generates two USN records: one for the old parent directory and one for the new parent directory. This allows you to track the movement of the directory.

Using ReadDirectoryChangesW

The ReadDirectoryChangesW function can monitor changes in a directory, including renames (which is how moves within the same volume are treated). Here's a basic example:

HANDLE hDir = CreateFile(
    L"C:\\path\\to\\directory",
    FILE_LIST_DIRECTORY,
    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
    NULL,
    OPEN_EXISTING,
    FILE_FLAG_BACKUP_SEMANTICS,
    NULL
);

if (hDir == INVALID_HANDLE_VALUE) {
    // Handle error
}

char buffer[1024];
DWORD bytesReturned;

while (ReadDirectoryChangesW(
    hDir,
    &buffer,
    sizeof(buffer),
    TRUE,
    FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME,
    &bytesReturned,
    NULL,
    NULL
)) {
    FILE_NOTIFY_INFORMATION* pNotify = (FILE_NOTIFY_INFORMATION*)buffer;
    do {
        if (pNotify->Action == FILE_ACTION_RENAMED_NEW_NAME) {
            // Handle the move/rename
        }
        pNotify = (FILE_NOTIFY_INFORMATION*)((char*)pNotify + pNotify->NextEntryOffset);
    } while (pNotify->NextEntryOffset != 0);
}

Using GetFileInformationByHandle

You can also use GetFileInformationByHandle to get the file index, which remains the same even if the file or directory is moved within the same volume².

Would you like more details on any of these methods?

Source: Conversation with Copilot, 8/14/2024
(1) How to detect a file move under win32 NTFS? - Stack Overflow. https://stackoverflow.com/questions/35242661/how-to-detect-a-file-move-under-win32-ntfs.
(2) How to see if a subfile of a directory has changed. https://stackoverflow.com/questions/56682/how-to-see-if-a-subfile-of-a-directory-has-changed.
(3) win32/desktop-src/FileIO/distributed-link-tracking-and-object ... - GitHub. https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/FileIO/distributed-link-tracking-and-object-identifiers.md.

@ghost commented on GitHub (Aug 14, 2024): @thalieht thats not the same request that tool is for my other Feature Request that I raised This one would be better done by NTFS ID tracking and USN Journal checking. Or a more stupider directory traversal to match a directory name only should also be sufficient to satisfy this scenario. To track where a directory has been moved on the same NTFS volume using the Win32 API, you can utilize the **USN (Update Sequence Number) Journal** or the **ReadDirectoryChangesW** function. ### Using USN Journal The USN Journal provides a record of changes made to files and directories on an NTFS volume. When a directory is moved, it generates two USN records: one for the old parent directory and one for the new parent directory. This allows you to track the movement of the directory. ### Using ReadDirectoryChangesW The `ReadDirectoryChangesW` function can monitor changes in a directory, including renames (which is how moves within the same volume are treated). Here's a basic example: ```cpp HANDLE hDir = CreateFile( L"C:\\path\\to\\directory", FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); if (hDir == INVALID_HANDLE_VALUE) { // Handle error } char buffer[1024]; DWORD bytesReturned; while (ReadDirectoryChangesW( hDir, &buffer, sizeof(buffer), TRUE, FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME, &bytesReturned, NULL, NULL )) { FILE_NOTIFY_INFORMATION* pNotify = (FILE_NOTIFY_INFORMATION*)buffer; do { if (pNotify->Action == FILE_ACTION_RENAMED_NEW_NAME) { // Handle the move/rename } pNotify = (FILE_NOTIFY_INFORMATION*)((char*)pNotify + pNotify->NextEntryOffset); } while (pNotify->NextEntryOffset != 0); } ``` ### Using GetFileInformationByHandle You can also use `GetFileInformationByHandle` to get the file index, which remains the same even if the file or directory is moved within the same volume². Would you like more details on any of these methods? Source: Conversation with Copilot, 8/[1](https://stackoverflow.com/questions/35242661/how-to-detect-a-file-move-under-win32-ntfs)4/2024 (1) How to detect a file move under win32 NTFS? - Stack Overflow. https://stackoverflow.com/questions/35242661/how-to-detect-a-file-move-under-win32-ntfs. (2) How to see if a subfile of a directory has changed. https://stackoverflow.com/questions/56682/how-to-see-if-a-subfile-of-a-directory-has-changed. (3) win32/desktop-src/FileIO/distributed-link-tracking-and-object ... - GitHub. https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/FileIO/distributed-link-tracking-and-object-identifiers.md.
Author
Owner

@ghost commented on GitHub (Aug 14, 2024):

The previous may not be correct Gemini didnt like it at all I dont know why.

Heres another by Bing Copilot again:

Sure! Here's a modern C++ variant that uses the C++ Standard Library and RAII principles to make the code more concise and safer:

Example Code in C++

#include <iostream>
#include <filesystem>
#include <string>

namespace fs = std::filesystem;

void find_directory(const fs::path& root_dir, const std::string& target_dir_name) {
    for (const auto& entry : fs::recursive_directory_iterator(root_dir)) {
        if (entry.is_directory() && entry.path().filename() == target_dir_name) {
            std::cout << "Directory found at: " << entry.path() << std::endl;
            return;
        }
    }
    std::cout << "Directory not found." << std::endl;
}

int main() {
    fs::path root_directory = "C:\\path\\to\\search";
    std::string directory_name = "missing_directory";

    find_directory(root_directory, directory_name);
    return 0;
}

Explanation

  • std::filesystem: This library, introduced in C++17, provides facilities for performing operations on file systems and their components, such as paths, regular files, and directories.
  • fs::recursive_directory_iterator: This iterator recursively iterates over the directory entries.
  • RAII: The use of RAII (Resource Acquisition Is Initialization) ensures that resources are properly managed and released.

This modern C++ approach is more concise and leverages the power of the C++ Standard Library to handle file system operations efficiently.

Would you like any further details or modifications to this code?

@ghost commented on GitHub (Aug 14, 2024): The previous may not be correct Gemini didnt like it at all I dont know why. Heres another by Bing Copilot again: Sure! Here's a modern C++ variant that uses the C++ Standard Library and RAII principles to make the code more concise and safer: ### Example Code in C++ ```cpp #include <iostream> #include <filesystem> #include <string> namespace fs = std::filesystem; void find_directory(const fs::path& root_dir, const std::string& target_dir_name) { for (const auto& entry : fs::recursive_directory_iterator(root_dir)) { if (entry.is_directory() && entry.path().filename() == target_dir_name) { std::cout << "Directory found at: " << entry.path() << std::endl; return; } } std::cout << "Directory not found." << std::endl; } int main() { fs::path root_directory = "C:\\path\\to\\search"; std::string directory_name = "missing_directory"; find_directory(root_directory, directory_name); return 0; } ``` ### Explanation - **std::filesystem**: This library, introduced in C++17, provides facilities for performing operations on file systems and their components, such as paths, regular files, and directories. - **fs::recursive_directory_iterator**: This iterator recursively iterates over the directory entries. - **RAII**: The use of RAII (Resource Acquisition Is Initialization) ensures that resources are properly managed and released. This modern C++ approach is more concise and leverages the power of the C++ Standard Library to handle file system operations efficiently. Would you like any further details or modifications to this code?
Author
Owner

@ghost commented on GitHub (Aug 14, 2024):

Gemini liked this one:

Improving the Code: Considerations and Enhancements

Excellent code! The use of std::filesystem is spot on for modern C++ file system operations.

Potential Enhancements:

  1. Error Handling:

    • Consider adding error handling for cases like invalid paths, permission issues, or filesystem errors.
    • Use exceptions or return codes to indicate failure.
  2. Case-Insensitive Search (Windows):

    • If you need case-insensitive search on Windows, you can convert both the target directory name and the found directory name to lowercase before comparison.
  3. Recursive Depth Control:

    • If you want to limit the search depth, you can add a depth parameter to the function and decrement it recursively.
  4. Performance Optimization:

    • For large file systems, consider using parallel processing or asynchronous operations to improve performance.
  5. Additional Information:

    • You might want to return the found path instead of printing it, allowing for further processing.

Revised Code with Enhancements:

#include <iostream>
#include <filesystem>
#include <string>

namespace fs = std::filesystem;

std::optional<fs::path> find_directory(const fs::path& root_dir, const std::string& target_dir_name, int max_depth = std::numeric_limits<int>::max()) {
    try {
        for (const auto& entry : fs::recursive_directory_iterator(root_dir)) {
            if (entry.is_directory() && entry.path().filename().string() == target_dir_name) {
                return entry.path();
            }
            if (entry.depth() >= max_depth) {
                break;
            }
        }
    } catch (const fs::filesystem_error& e) {
        std::cerr << "Error: " << e.what() << std::endl;
    }
    return std::nullopt;
}

int main() {
    fs::path root_directory = "C:\\path\\to\\search";
    std::string directory_name = "missing_directory";

    auto found_path = find_directory(root_directory, directory_name, 3); // Limit search depth to 3 levels
    if (found_path) {
        std::cout << "Directory found at: " << *found_path << std::endl;
    } else {
        std::cout << "Directory not found." << std::endl;
    }
    return 0;
}

This revised code incorporates error handling, a depth limit, and returns the found path as an optional. It also demonstrates how to use std::numeric_limits for a default maximum depth.

Would you like to explore any of these enhancements further or discuss other requirements?

@ghost commented on GitHub (Aug 14, 2024): Gemini liked this one: ## Improving the Code: Considerations and Enhancements **Excellent code!** The use of `std::filesystem` is spot on for modern C++ file system operations. ### Potential Enhancements: 1. **Error Handling:** * Consider adding error handling for cases like invalid paths, permission issues, or filesystem errors. * Use exceptions or return codes to indicate failure. 2. **Case-Insensitive Search (Windows):** * If you need case-insensitive search on Windows, you can convert both the target directory name and the found directory name to lowercase before comparison. 3. **Recursive Depth Control:** * If you want to limit the search depth, you can add a depth parameter to the function and decrement it recursively. 4. **Performance Optimization:** * For large file systems, consider using parallel processing or asynchronous operations to improve performance. 5. **Additional Information:** * You might want to return the found path instead of printing it, allowing for further processing. ### Revised Code with Enhancements: ```cpp #include <iostream> #include <filesystem> #include <string> namespace fs = std::filesystem; std::optional<fs::path> find_directory(const fs::path& root_dir, const std::string& target_dir_name, int max_depth = std::numeric_limits<int>::max()) { try { for (const auto& entry : fs::recursive_directory_iterator(root_dir)) { if (entry.is_directory() && entry.path().filename().string() == target_dir_name) { return entry.path(); } if (entry.depth() >= max_depth) { break; } } } catch (const fs::filesystem_error& e) { std::cerr << "Error: " << e.what() << std::endl; } return std::nullopt; } int main() { fs::path root_directory = "C:\\path\\to\\search"; std::string directory_name = "missing_directory"; auto found_path = find_directory(root_directory, directory_name, 3); // Limit search depth to 3 levels if (found_path) { std::cout << "Directory found at: " << *found_path << std::endl; } else { std::cout << "Directory not found." << std::endl; } return 0; } ``` This revised code incorporates error handling, a depth limit, and returns the found path as an optional. It also demonstrates how to use `std::numeric_limits` for a default maximum depth. **Would you like to explore any of these enhancements further or discuss other requirements?**
Author
Owner

@ghost commented on GitHub (Aug 14, 2024):

Yes, you can achieve similar simplicity in qBittorrent's C++ codebase by leveraging the C++ Standard Library and modern C++ features. Here's a conceptual approach to finding a missing folder within qBittorrent:

Example Code in Modern C++

#include <iostream>
#include <filesystem>
#include <string>

namespace fs = std::filesystem;

void find_directory(const fs::path& root_dir, const std::string& target_dir_name) {
    for (const auto& entry : fs::recursive_directory_iterator(root_dir)) {
        if (entry.is_directory() && entry.path().filename() == target_dir_name) {
            std::cout << "Directory found at: " << entry.path() << std::endl;
            return;
        }
    }
    std::cout << "Directory not found." << std::endl;
}

int main() {
    fs::path root_directory = "C:\\path\\to\\search";
    std::string directory_name = "missing_directory";

    find_directory(root_directory, directory_name);
    return 0;
}

Explanation

  • std::filesystem: This library, introduced in C++17, provides facilities for performing operations on file systems and their components, such as paths, regular files, and directories.
  • fs::recursive_directory_iterator: This iterator recursively iterates over the directory entries.
  • RAII: The use of RAII (Resource Acquisition Is Initialization) ensures that resources are properly managed and released.

Integration with qBittorrent

To integrate this functionality into qBittorrent, you would:

  1. Add the Function: Include the find_directory function in the appropriate part of the qBittorrent codebase.
  2. Call the Function: Invoke this function when you need to locate a missing folder, passing the root directory and the name of the missing folder as arguments.

This approach leverages modern C++ features to keep the code concise and efficient, making it easier to maintain and understand.

Would you like more details on integrating this into qBittorrent or any other assistance?

Source: Conversation with Copilot, 8/14/2024
(1) QBittorrent downloads missing - QNAP NAS Community Forum. https://forum.qnap.com/viewtopic.php?t=165110.
(2) After restarting, qBittorrent(run in portable mode) report `Missing .... https://github.com/qbittorrent/qBittorrent/issues/17437.
(3) I/O error because of "missing" files · Issue #7917 · qbittorrent .... https://github.com/qbittorrent/qBittorrent/issues/7917.
(4) using an incomplete folder and moving the torrents causes 'missing .... https://github.com/qbittorrent/qBittorrent/issues/3223.
(5) How do I fix Missing Files error? : r/qBittorrent - Reddit. https://www.reddit.com/r/qBittorrent/comments/1bp23og/how_do_i_fix_missing_files_error/.
(6) undefined. https://github.com/qbittorrent/qBittorrent/actions/runs/2737055361.

@ghost commented on GitHub (Aug 14, 2024): Yes, you can achieve similar simplicity in qBittorrent's C++ codebase by leveraging the C++ Standard Library and modern C++ features. Here's a conceptual approach to finding a missing folder within qBittorrent: ### Example Code in Modern C++ ```cpp #include <iostream> #include <filesystem> #include <string> namespace fs = std::filesystem; void find_directory(const fs::path& root_dir, const std::string& target_dir_name) { for (const auto& entry : fs::recursive_directory_iterator(root_dir)) { if (entry.is_directory() && entry.path().filename() == target_dir_name) { std::cout << "Directory found at: " << entry.path() << std::endl; return; } } std::cout << "Directory not found." << std::endl; } int main() { fs::path root_directory = "C:\\path\\to\\search"; std::string directory_name = "missing_directory"; find_directory(root_directory, directory_name); return 0; } ``` ### Explanation - **std::filesystem**: This library, introduced in C++17, provides facilities for performing operations on file systems and their components, such as paths, regular files, and directories. - **fs::recursive_directory_iterator**: This iterator recursively iterates over the directory entries. - **RAII**: The use of RAII (Resource Acquisition Is Initialization) ensures that resources are properly managed and released. ### Integration with qBittorrent To integrate this functionality into qBittorrent, you would: 1. **Add the Function**: Include the `find_directory` function in the appropriate part of the qBittorrent codebase. 2. **Call the Function**: Invoke this function when you need to locate a missing folder, passing the root directory and the name of the missing folder as arguments. This approach leverages modern C++ features to keep the code concise and efficient, making it easier to maintain and understand. Would you like more details on integrating this into qBittorrent or any other assistance? Source: Conversation with Copilot, 8/14/2024 (1) QBittorrent downloads missing - QNAP NAS Community Forum. https://forum.qnap.com/viewtopic.php?t=165110. (2) After restarting, qBittorrent(run in portable mode) report `Missing .... https://github.com/qbittorrent/qBittorrent/issues/17437. (3) I/O error because of "missing" files · Issue #7917 · qbittorrent .... https://github.com/qbittorrent/qBittorrent/issues/7917. (4) using an incomplete folder and moving the torrents causes 'missing .... https://github.com/qbittorrent/qBittorrent/issues/3223. (5) How do I fix Missing Files error? : r/qBittorrent - Reddit. https://www.reddit.com/r/qBittorrent/comments/1bp23og/how_do_i_fix_missing_files_error/. (6) undefined. https://github.com/qbittorrent/qBittorrent/actions/runs/2737055361.
Author
Owner

@ghost commented on GitHub (Aug 14, 2024):

Certainly! C++20 introduces several new features that can make the code even more concise and expressive. Here's an updated version of the directory search function using C++20 features:

Example Code in C++20

#include <iostream>
#include <filesystem>
#include <string>
#include <ranges>

namespace fs = std::filesystem;

void find_directory(const fs::path& root_dir, const std::string& target_dir_name) {
    auto directories = fs::recursive_directory_iterator(root_dir) 
                     | std::views::filter([](const auto& entry) { return entry.is_directory(); });

    for (const auto& entry : directories) {
        if (entry.path().filename() == target_dir_name) {
            std::cout << "Directory found at: " << entry.path() << std::endl;
            return;
        }
    }
    std::cout << "Directory not found." << std::endl;
}

int main() {
    fs::path root_directory = "C:\\path\\to\\search";
    std::string directory_name = "missing_directory";

    find_directory(root_directory, directory_name);
    return 0;
}

Explanation

  • std::ranges: C++20 introduces the ranges library, which allows for more expressive and readable code when working with sequences of data.
  • std::views::filter: This view filters the entries to include only directories, making the iteration more efficient and focused.

Integration with qBittorrent

To integrate this functionality into qBittorrent:

  1. Add the Function: Include the find_directory function in the appropriate part of the qBittorrent codebase.
  2. Call the Function: Invoke this function when you need to locate a missing folder, passing the root directory and the name of the missing folder as arguments.

This approach leverages modern C++20 features to keep the code concise, efficient, and easy to understand.

Would you like more details on integrating this into qBittorrent or any other assistance?

@ghost commented on GitHub (Aug 14, 2024): Certainly! C++20 introduces several new features that can make the code even more concise and expressive. Here's an updated version of the directory search function using C++20 features: ### Example Code in C++20 ```cpp #include <iostream> #include <filesystem> #include <string> #include <ranges> namespace fs = std::filesystem; void find_directory(const fs::path& root_dir, const std::string& target_dir_name) { auto directories = fs::recursive_directory_iterator(root_dir) | std::views::filter([](const auto& entry) { return entry.is_directory(); }); for (const auto& entry : directories) { if (entry.path().filename() == target_dir_name) { std::cout << "Directory found at: " << entry.path() << std::endl; return; } } std::cout << "Directory not found." << std::endl; } int main() { fs::path root_directory = "C:\\path\\to\\search"; std::string directory_name = "missing_directory"; find_directory(root_directory, directory_name); return 0; } ``` ### Explanation - **std::ranges**: C++20 introduces the ranges library, which allows for more expressive and readable code when working with sequences of data. - **std::views::filter**: This view filters the entries to include only directories, making the iteration more efficient and focused. ### Integration with qBittorrent To integrate this functionality into qBittorrent: 1. **Add the Function**: Include the `find_directory` function in the appropriate part of the qBittorrent codebase. 2. **Call the Function**: Invoke this function when you need to locate a missing folder, passing the root directory and the name of the missing folder as arguments. This approach leverages modern C++20 features to keep the code concise, efficient, and easy to understand. Would you like more details on integrating this into qBittorrent or any other assistance?
Author
Owner

@thalieht commented on GitHub (Aug 14, 2024):

I'll... let the devs decide then.

@thalieht commented on GitHub (Aug 14, 2024): I'll... let the devs decide then.
Author
Owner

@Patty-OFurniture commented on GitHub (Aug 16, 2024):

I'm not sure what many of those clarifications achieve.. Having implemented both infohash v1 processing and a filewatcher, I can tell you I would just close this one. If you need a torrent client to be aware of moves, do it in the torrent client. Otherwise, external solutions exist specific to your needs.

For this one, I would recommend doing a list of the relative filenames you expect, and then process "dir /b /s" output with a UNION, and a percentage threshold to determine if a subdir holds what you expect. Nothing will be more efficient.

I don't think a cross-platform solution is possible, or if it is possible, I would not want someone doing it, who is basically creating a UI over libtorrent. Not to cast aspersions, it's just that it won't be in any normal developer's wheelhouse. You need a special kind of person to be interested in this.

A filesystem watcher running at all times, especially if it is built in to and therefore requires the torrent client to be running all the time, is not a good solution at all.

I don't find support for "use GetFileInformationByHandle to get the file index, which remains the same" in the references provided. Reference 2 is the Windows filesystem watcher, and Reference 3 does not explicitly state that fact. And 3 refers to link tracking, as in does this point to the same object. GetFileInformationByHandle reference states "You can compare the VolumeSerialNumber and FileIndex members returned in the BY_HANDLE_FILE_INFORMATION structure to determine if two paths map to the same target" as in, right now, not were they once the same file.

NTFS journaling is the only real solution other than filesystem watcher, and besides being obviously platform and filesystem specific, it will not preserve changes to a different volume. So if you download on C: and move to D: on the same physical disk, I don't see how it's going to track that change based on the little reading I did until I got bored.

I'll stop now with a warning: be very careful about any AI assist, you have to understand enough to know if it's good advice as of today. Be careful as of today and consider whether the advice is current aka still the best or a better option exists.

@Patty-OFurniture commented on GitHub (Aug 16, 2024): I'm not sure what many of those clarifications achieve.. Having implemented both infohash v1 processing and a filewatcher, I can tell you I would just close this one. If you need a torrent client to be aware of moves, do it in the torrent client. Otherwise, external solutions exist specific to your needs. For this one, I would recommend doing a list of the relative filenames you expect, and then process "dir /b /s" output with a UNION, and a percentage threshold to determine if a subdir holds what you expect. Nothing will be more efficient. I don't think a cross-platform solution is possible, or if it is possible, I would not want someone doing it, who is basically creating a UI over libtorrent. Not to cast aspersions, it's just that it won't be in any normal developer's wheelhouse. You need a special kind of person to be interested in this. A filesystem watcher running at all times, especially if it is built in to and therefore requires the torrent client to be running all the time, is not a good solution at all. I don't find support for "use GetFileInformationByHandle to get the file index, which remains the same" in the references provided. Reference 2 is the Windows filesystem watcher, and Reference 3 does not explicitly state that fact. And 3 refers to *link* tracking, as in does this point to the same object. GetFileInformationByHandle reference states "You can compare the VolumeSerialNumber and FileIndex members returned in the [BY_HANDLE_FILE_INFORMATION](https://learn.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-by_handle_file_information) structure to determine if two paths map to the same target" as in, right now, not were they once the same file. NTFS journaling is the only real solution other than filesystem watcher, and besides being obviously platform *and* filesystem specific, it will not preserve changes to a different volume. So if you download on C: and move to D: on the same physical disk, I don't see how it's going to track that change based on the little reading I did until I got bored. I'll stop now with a warning: be very careful about any AI assist, you have to understand enough to know if it's good advice as of today. Be careful as of today and consider whether the advice is current aka still the best or a better option exists.
Author
Owner

@ghost commented on GitHub (Aug 16, 2024):

Info Updated and Closed. Other features that use similar API are more important for now.

@ghost commented on GitHub (Aug 16, 2024): Info Updated and Closed. Other features that use similar API are more important for now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#15985
No description provided.