Currently on linux copying file on the flash drive is showing momental progress 0 -> 100% and at the end of 100% is waiting while file are flushed on the drive.
This is almost linux bug with dirty_cache, but had another way to write the file. This patch is implements by checking what drive has dest file, and tryng to optimize of file writing by cheking is the device are "removable"(if true - appends O_SYNC for ::open) and how many kbytes device can transfer per single transfer. So for now, the progress bar is shows real percent of progress and abort or pause is working are propertly.
Details
- Reviewers
dfaure ossi thiago - Group Reviewers
Frameworks
Diff Detail
- Repository
- R241 KIO
- Lint
Lint Skipped - Unit
Unit Tests Skipped
I suppose put() should do the same, then?
b/src/ioslaves/file/file_unix.cpp | ||
---|---|---|
72 | Doesn't KMountPoint::currentMountPoints + findByPath already do this? | |
107 | Probably not, I don't see another user than kio_file for such detailed information. | |
226 | ... and then the code says 1024*1024 ;) A comment shouldn't say "what" (the code does that), but "why". | |
229 | make that &block_size and &is_removeable so that when reading this line it's clear that those are in+out vars. | |
232 | use std::clamp, this way you won't even have to repeat the min and max values. | |
241 | The conversion via std::string is incorrect, encoding wise. The way to pass a QString (for a filename) to a system call is QFile::encodeName(). | |
289 | C casts make me puke ;) | |
324 | .data() is more readable |
b/src/ioslaves/file/file_unix.cpp | ||
---|---|---|
241 | you want O_DSYNC |