Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QFileSystemEngine/Unix: implement getting the size of block devices
Implemented for Linux, macOS, and FreeBSD. This works only on open files because of the need to ioctl(). Before: "/dev/system/stuff2" : 0 After: "/dev/system/stuff2" : 68719476736 [Linux] "/dev/ada1" : 42949672960 [FreeBSD] "/dev/disk0" : 500277792768 [macOS] "/dev/disk2" : 39306240 [macOS] With: if (f.open(QIODevice::ReadOnly | QIODevice::Unbuffered)) qDebug() << f.fileName() << ':' << f.size(); [ChangeLog][QtCore][QFile] For open block devices on Unix systems, size() now returns the size of the underlying device. Previously, it would always return 0. Change-Id: I8a96935cf6c742259c9dfffd17e9402bdbd6b963 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
- Loading branch information