MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / copyFile

Method copyFile

Libraries/Async/Async.cpp:797–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795}
796
797SC::Result SC::AsyncFileSystemOperation::copyFile(AsyncEventLoop& eventLoop, StringSpan path,
798 StringSpan destinationPath, FileSystemCopyFlags copyFlags)
799{
800 SC_TRY(checkState());
801 operation = Operation::CopyFile;
802 new (&copyFileData, PlacementNew()) CopyFileData({path, destinationPath, copyFlags});
803 // TODO: Implement this on io_uring using two splice submissions with IOSQE_IO_LINK
804 loopWork.work = [&]()
805 {
806 SC_TRY(
807 FileSystem::Operations::copyFile(copyFileData.path, copyFileData.destinationPath, copyFileData.copyFlags));
808 return SC::Result(true);
809 };
810 loopWork.callback.bind<AsyncFileSystemOperation, &AsyncFileSystemOperation::onOperationCompleted>(*this);
811 return eventLoop.start(loopWork);
812}
813
814SC::Result SC::AsyncFileSystemOperation::rename(AsyncEventLoop& eventLoop, StringSpan path, StringSpan newPath)
815{

Callers 2

copyExistsFileMethod · 0.45
await_suspendMethod · 0.45

Calls 4

PlacementNewClass · 0.85
copyFileFunction · 0.85
ResultClass · 0.70
startMethod · 0.45

Tested by 1

copyExistsFileMethod · 0.36