[Bug] Check disk space of actual directory instead of parent directory
What version of WinBoat are you running?
0.8.7
Your Environment
Linux Distro: NixOS Desktop Environment: i3 FreeRDP: not sure, can check, but irrelevant
Steps to Reproduce / Context
I have / mounted as tmpfs which is only allotted 4 GB. I instead have very specific directories that are mounted to my persistent storage.
While giving Winboat the install location for a Windows VM, it appends winboat to the directory path that I give it. So, I chose a parent directory of ~/.local/state/ for the resulting dir to be ~/.local/state/winboat/. But Winboat complains about disk space, which is only 3 GB remaining in ~/.local/state/ but there's >200 GB available in ~/.local/state/winboat/.
The disk space complaint seems like a bug since why check the parent directory? I'm assuming it's because Winboat assumes the appended winboat dir to not exist yet so it can't really check for the amount of available disk space within it. But this breaks in my environment and would love to see a fix :)
Logs
nothing relevant
Expected Behavior
Check the disk space of the resultant directory after appending winboat to the install path.
Current Behavior
Checks the parent directory's available disk space.
Possible Solution
I'm not sure. I'm fairly certain that Winboat doesn't check the resultant directory's disk space because it assumes it to not have been created. Changing this behaviour would be a non-trivial change on expectations.
Quality Notice
- [x] I have checked the issue tracker and verified that this bug is a unique case.
This is a good first-issue for someone to pick up.
In SetupUI#installFolderErrors: After checking that the parent dir is writable, create (equiv to mkdir -p) the winboat directory and check diskspace from that path). If the check fails, rm the winboat dir to clean up.
I'm trying that. But wouldn't it be nicer if the behaviour was such that the user is prompted to choose the installation directory itself instead of its parent directory? WDYT?