datafusion-contrib / tpctools

Tools for generating TPC-* datasets
Apache License 2.0
26 stars 5 forks source link

Error: Os { code: 18, kind: CrossesDevices, message: "Invalid cross-device link" } #4

Closed andygrove closed 1 year ago

andygrove commented 1 year ago

When you attempt to rename files across different file systems or devices using std::fs::rename, it will fail, because this function works by making a system call that simply updates the filesystem metadata and does not actually move file data.

If you need to move a file from one file system (or device) to another, you'll generally need to copy it to the new location and then remove it from the original location. Here’s a simple example in Rust using std::fs::copy for copying the file and std::fs::remove_file for removing the original file: