-
-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QStorageInfo for file system boundaries #1
Comments
Thanks for that information! I didn't have QStorageInfo on my radar. Yes, this would definitely be something worth investigating. I just have no idea exactly how big the performance impact would be. I'd have to check that for each new directory encountered in the filesystem tree. Maybe QStorageInfo::mountedVolumes() might be a good starting point (since AFAICS the QStorageInfo constructor wants the mount point, not a random directory on that volume). For the purpose of QDirStat, I'd welcome a QFileInfo::device() method that would return a device name ("/dev/sda2") or a Windows drive ("C:"). I am sure this shouldn't be that hard to do, and it would not break the OS abstraction layer (unlike device major/minor numbers that don't have a counterpart in the Windows world). Qt4 backwards compatibility is just a nice-to-have feature. And it could be #ifdef'ed out for the pathological combinations (like Windows / MacOS X + Qt4). It would affect me on my machines at home more since here I am using Kubuntu 14.04 LTS that come with Qt 5.2, but I could handle that (#ifdef again). Anyway, thanks for the heads-up! Kind regards + merry Christmas from Germany |
OK, this was not necessary for MacOS X: It provides all the necessary POSIX calls. For Windows, this is a non-issue since everything is limited to one drive anyway. Still, it was a good idea, but it isn't necessary any more. Thanks anyway for contributing this idea! |
OK, nice to know it works well anywhere. :) Note that Windows has this weird reparse points, so yeah, you can mount a file system in a file system (I've done that using Dokan, a FUSE-like project) but probably not many users will hit that case so far. |
Hi. I would like to ask/propose, whether would it be possible to use QStorageInfo to get the underlying device of a path, and thus know when you crossed a file system boundary. QStorageInfo was new in 5.4, so that would kill Qt4 support, unfortunately, but I don't know if that's really a goal of the project.
That's one of the things mentioned in the README (maybe the only one?) that requires non cross-platform code. I would like to know your opinion, since I'm collecting some notes on possible limitations/shortcomings of the Qt API for file systems. Maybe adding QFileInfo::device() (instead of having to construct the QStorageInfo from the path) would be also more convenient.
The text was updated successfully, but these errors were encountered: