diff --git a/src/libs/utils/devicefileaccess.cpp b/src/libs/utils/devicefileaccess.cpp index 50d1f276ef1..303ffa6bf50 100644 --- a/src/libs/utils/devicefileaccess.cpp +++ b/src/libs/utils/devicefileaccess.cpp @@ -1059,6 +1059,10 @@ expected_str UnixDeviceFileAccess::fileContents(const FilePath &file if (disconnected()) return make_unexpected_disconnected(); + expected_str localSource = filePath.localSource(); + if (localSource && *localSource != filePath) + return localSource->fileContents(limit, offset); + QStringList args = {"if=" + filePath.path()}; if (limit > 0 || offset > 0) { const qint64 gcd = std::gcd(limit, offset); @@ -1088,6 +1092,10 @@ expected_str UnixDeviceFileAccess::writeFileContents(const FilePath &fil if (disconnected()) return make_unexpected_disconnected(); + expected_str localSource = filePath.localSource(); + if (localSource && *localSource != filePath) + return localSource->writeFileContents(data); + QStringList args = {"of=" + filePath.path()}; RunResult result = runInShell({"dd", args, OsType::OsTypeLinux}, data);