libelektra icon indicating copy to clipboard operation
libelektra copied to clipboard

proposal: change behavior of kdb mount for non-existing mountpoints

Open qwepoizt opened this issue 4 years ago • 2 comments
trafficstars

  • Currently, kdb mount accepts mountpoints, regardless of whether these mountpoints actually exist.
  • Example: kdb mount ~/thisfiledoesnotexist.ni spec:/test ni has return code 0 and prints nothing to stdout/err.
  • This can be irritating, if one wants to actually mount an existing file, but by accident specifies a wrong path. Then kdb mount does not fail or warn about the mountpoint not existing, so the user won't know they made a mistake.
  • The fact that kdb mount expects an absolute path makes this even a bigger problem, because users might try to cd ~/existingdirectory && kdb mount thisfiledoesexist.ni spec:/test ni to mount ~/thisfiledoesexist.ni. This won't work, because the path to the file was not given as absolute.
  • I was "tricked" by this behavior of kdb mount many times :) It's especially tricky in mingw builds, where paths are irritating already (e.g. are you supposed to use "C:/Users/..." or "C:\Users..." or "/c/Users", ...). If kdb mount warned about the mountpoint not existing, it would be easier to pick the right "path style".
  • I guess it is a feature to use kdb mount with a non existing mountpoint and have Elektra create a file once a kdb set occurs. Maybe it could default to fail and only accept non-existing mountpoints, if a new flag (e.g. a shortened version of kdb --allow-non-existing-mountpoint) is set?

qwepoizt avatar Sep 27 '21 22:09 qwepoizt

Thank you so much for reporting this usability problem! :revolving_hearts:

Yes, I agree that checkFile in src/plugins/resolver/filename.c and also src/plugins/wresolver/wresolver.c would be much more useful if it also checks if a file is present.

But I am afraid that printing a warning in src/libs/tools/src/backend.cpp is the most what we can do. Aborting on non-existing files would be too much as this is a 100% valid operation: empty files are the representation for an empty KeySet. Furthermore, the checking functionality only makes sense for non-cascading mountpoints.

markus2330 avatar Sep 29 '21 14:09 markus2330

Thanks for your comment!

I think a warning - that includes the absolute file path that was tried - would suffice and be of great help already: It would help users that wanted to mount an existing file with troubleshooting the issue.

qwepoizt avatar Oct 06 '21 09:10 qwepoizt

I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

github-actions[bot] avatar Aug 07 '23 01:08 github-actions[bot]

I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

github-actions[bot] avatar Aug 22 '23 01:08 github-actions[bot]