drives

How to get drive label in Linux using C from userspace

拜拜、爱过 提交于 2019-12-04 05:21:49
问题 I need to get a label for specific device using c/c++ (and no d-bus) in linux. The problem is that i can't just open device and read it's information (for extN it is very easy to get label from device) because reading from /dev/xxx requires root privileges. 回答1: I think in most distributions now you have /dev/disk/by-label/ which is filled with symlinks that point to the real device. 来源: https://stackoverflow.com/questions/4112964/how-to-get-drive-label-in-linux-using-c-from-userspace

Delphi - How to get list of USB removable hard drives and memory sticks?

笑着哭i 提交于 2019-12-03 03:21:20
问题 In my application (Delphi), I need to list all the USB storage devices. These can be either flash memory sticks or external storage drives. There is a Jvcl component JvDriveCombo , and it has the DriveType property - the problem is if I select DriveType := Fixed then in addition to the external drive, it also lists the internal drives ( C:\ , D:\ etc). However, I only want to list the external drives. I believe there is DeviceIoControl function (I saw it on MSDN) but I have no idea of how to

Delphi - How to get list of USB removable hard drives and memory sticks?

一世执手 提交于 2019-12-02 16:49:59
In my application (Delphi), I need to list all the USB storage devices. These can be either flash memory sticks or external storage drives. There is a Jvcl component JvDriveCombo , and it has the DriveType property - the problem is if I select DriveType := Fixed then in addition to the external drive, it also lists the internal drives ( C:\ , D:\ etc). However, I only want to list the external drives. I believe there is DeviceIoControl function (I saw it on MSDN) but I have no idea of how to use it. I wonder if anyone can help me with the proper way / code to list USB storage devices? Thanks.

How to get drive label in Linux using C from userspace

ぐ巨炮叔叔 提交于 2019-12-02 07:28:28
I need to get a label for specific device using c/c++ (and no d-bus) in linux. The problem is that i can't just open device and read it's information (for extN it is very easy to get label from device) because reading from /dev/xxx requires root privileges. I think in most distributions now you have /dev/disk/by-label/ which is filled with symlinks that point to the real device. 来源: https://stackoverflow.com/questions/4112964/how-to-get-drive-label-in-linux-using-c-from-userspace

DriveInfo.GetDrives() not returning mapped drives when run as administrator

孤人 提交于 2019-11-30 22:08:40
I'm creating a WPF app that among other things should check for the existence of several mapped drives. The code is straightforward: DriveInfo[] systemDrives = DriveInfo.GetDrives(); foreach (DriveInfo i in systemDrives) { if ((i.Name.Contains("V")) && (i.IsReady)) { result = true; break; } } The mapped drives are mapped fro all users. The code above works fine when run as a regular user, however is Visual Studio 2010 is run as administrator the GetDrives method only returns the Fixed drives and the DVD drive but not the mapped drives. The same happens if the executable is run as an

Advertised disk space vs actual disk space [closed]

Deadly 提交于 2019-11-29 19:10:50
问题 Why is it that advertised disk space is almost always higher than the disk space reported by the UI? For example, I have an "80 gb" hard drive, but the iTunes UI indicates only 74. I usually see this as well with hard disks and the amount reported with the drive letter. 回答1: There are 3 reasons why the amount of space you can actually use is different from that listed for the drive, all of which work against you: Hard drive manufacturers treat 1GB as one billion bytes, while the operating

Enumerating all available drive letters in Windows

自古美人都是妖i 提交于 2019-11-27 01:58:51
I want to enumerate all available drive letters (which aren't already taken) in Windows using VC++. How can I do this? JTeagle ::GetLogicalDrives() returns a list of available (read: used) drives as bits in a mask. This should include mapped network drives. Thus, you can simply walk the bits to find bits that are zero, meaning no drive is present. If in doubt, you can always call ::GetDriveType() with the drive letter + ":\" ( ":\\" in C code, or _T(":\\") in Unicode-aware terminology, of course), and that should return DRIVE_UNKNOWN or DRIVE_NO_ROOT_DIR if the drive is available.

Enumerating all available drive letters in Windows

馋奶兔 提交于 2019-11-26 09:50:56
问题 I want to enumerate all available drive letters (which aren\'t already taken) in Windows using VC++. How can I do this? 回答1: ::GetLogicalDrives() returns a list of available (read: used) drives as bits in a mask. This should include mapped network drives. Thus, you can simply walk the bits to find bits that are zero, meaning no drive is present. If in doubt, you can always call ::GetDriveType() with the drive letter + ":\" ( ":\\" in C code, or _T(":\\") in Unicode-aware terminology, of