| 831 | } |
| 832 | |
| 833 | SC::Result SC::AsyncFileSystemOperation::removeEmptyDirectory(AsyncEventLoop& eventLoop, StringSpan path) |
| 834 | { |
| 835 | SC_TRY(checkState()); |
| 836 | operation = Operation::RemoveDirectory; |
| 837 | new (&removeData, PlacementNew()) RemoveData({path}); |
| 838 | if (not eventLoop.needsThreadPoolForFileOperations() and threadPoolMode != AsyncThreadPoolMode::ForceThreadPool) |
| 839 | { |
| 840 | return eventLoop.start(*this); |
| 841 | } |
| 842 | |
| 843 | loopWork.work = [&]() |
| 844 | { |
| 845 | SC_TRY(FileSystem::Operations::removeEmptyDirectory(removeData.path)); |
| 846 | return SC::Result(true); |
| 847 | }; |
| 848 | loopWork.callback.bind<AsyncFileSystemOperation, &AsyncFileSystemOperation::onOperationCompleted>(*this); |
| 849 | return eventLoop.start(loopWork); |
| 850 | } |
| 851 | |
| 852 | SC::Result SC::AsyncFileSystemOperation::removeFile(AsyncEventLoop& eventLoop, StringSpan path) |
| 853 | { |