Looking for a reliable way to determine if a drive letter is in use
#9
On Linux this is ridiculously easy:

On Debian/Ubuntu check in "/media/(user)" for additional subdirectories.

On almost other Linux OS check in "/run/media/(user)".

Use _DIREXISTS for it.

There are no drive letters to worry about. However this depends whether or not the pluggable disk was given a volume label. If not then it becomes harder to track down an UUID to identify that disk. That UUID doesn't change if the disk is plugged into a different Linux OS or a different computer into a Linux OS.

Fiddling with certain programs (which require administrative privileges anyway) could do something about it. On most systems, however, GNOME Disk Utility does not require the "root" password to delete partitions and reformat disks! Be careful out there.



What is the result of "vol F:" on the terminal on Windows?
Reply


Messages In This Thread
RE: Looking for a reliable way to determine if a drive letter is in use - by mnrvovrfc - 05-08-2023, 04:53 PM



Users browsing this thread: 8 Guest(s)