Anything related to disk-like storage media, like hard-disks, CDs, DVDs, etc. By extension it could be applied to other mass storage media that are commonly referred as "disks", like SSD, flash cards, etc.
Questions tagged [disk]
1293 questions
4
votes
2 answers
Determine what physical hard drive a file is on?
How can I find the physical drive a file/directory is located on. I want to compare 2 files and if they are on two separate drives, then I can speed up the compare by reading both simultaneously.
Regards

Peter
- 1,685
- 3
- 16
- 22
4
votes
0 answers
Does fstream::flush() or fstream::sync() guarantee the data have been written to the disk?
I'm writing a mini database by using C++. In log module, I use fstream to append data to log file and I need data to be immediately written to disk. In http://www.cplusplus.com/doc/tutorial/files/, I find
When the buffer is flushed, all the data…

梁宇坤
- 66
- 4
4
votes
2 answers
where is disk scheduling implemented
I'm recently learning the part of disk scheduling of operating system. And I could understand the various algorithms for this issue, like FCFS, LIFO, SSTF, SCAN and so on. But I was wondering where these algorithms are implemented?
I don't think…

Mengfan Ma
- 351
- 2
- 13
4
votes
2 answers
How to loop in Bash until reaching free disk space limit?
I would like to do a set of operations (x y z) as long as I have at least 200MB free space on file-system mounted to /media/z.
How can I do that?
I tried something like
while (`df | grep /media/z | awk '{print $4}'` > 204800); do x; y; z; done;
but…

David B
- 29,258
- 50
- 133
- 186
4
votes
2 answers
XCTest: Load file from disk without Bundle on all platforms (Xcode, SPM Mac/Linux)
I am looking for a way to load files from disk within an XCTestCase that does not depend on Bundle.
Bundle works well when running the tests from Xcode (or with xcodebuild on the terminal), but bundles are part of the Xcode project and not available…

Eneko Alonso
- 18,884
- 9
- 62
- 84
4
votes
0 answers
Speed up createFile call on volumes
I'm writing a software to communicate to a recording device that
if connected to the pc via USB emulates a mass storage device.
Some special features are accessed on that device by communicating
on a special sector on that device. To get access on…

mrabat
- 802
- 7
- 15
4
votes
0 answers
How to get raw disk access in python (windows) for disks > 2TB
I am trying to get raw disk access using python on windows to drives >2TB using python.
Everything works great for disks under 2TB using wmi to find details about the disk size but for a 4TB drive it only sees the first 2TB.
I assume it is because…

Robert Fearn
- 49
- 3
4
votes
3 answers
Get hardware information from /proc filesytem in Linux
I use execv to run lshw command to get the CPU, disk, and memory in C code. But I would like to search another solution to get these information from /proc or any other existed data. Have any suggestion? Here is my code:
char *params[9] =…

charles.cc.hsu
- 689
- 11
- 15
4
votes
2 answers
Getting Disk Size Properly
I am trying to get the physical device size of a connected USB flash drive. I have tried using WMI.
ManagementObjectSearcher mosDisks = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive WHERE Model = '" + cmbHdd.SelectedItem +…

Eaton
- 1,310
- 2
- 15
- 31
4
votes
2 answers
How can the block size of a file store be portably obtained in Java 7?
I've looked at java.nio.file.attribute.Attributes and java.nio.file.FileStore, but couldn't find a way to discover the block-size of a disk-file.

Steve Emmerson
- 7,702
- 5
- 33
- 59
4
votes
1 answer
Disk seek time measurement method
I write a script to measure seek times on a HDD and a small change in how its done results in dramatically different times.
First cycle makes jumps within an area at beginning of the disk. Second cycle selects random areas (of same size) on disk…

ArekBulski
- 4,520
- 4
- 39
- 61
4
votes
2 answers
How does one programmatically mount a drive in Windows?
We make and sell a device that our users will sometimes want to connect to their computer in large quantities with multiple USB hubs. It is a USB composite device that has both human interface (HID) and mass storage (MSD) interfaces. Windows…

Judge Maygarden
- 26,961
- 9
- 82
- 99
4
votes
1 answer
C++ write options
I'm trying to open a file for writing using std::ofstream and I want to set it in write-through mode (i.e. like using the "FILE_FLAG_WRITE_THROUGH " provided by CreateFile Win API).
Is there some STL way to achieve it?
I don't want to write code…

Alfatau
- 233
- 2
- 8
4
votes
2 answers
Correlate Physical Device ID to Volume Device ID
I'm trying to utilize WMI via PowerShell to run through SAN storage on remote servers to grab the Windows disk management volume label.
The only way I've found to do this is to correlate the volume device id (\\?\Volume{34243...} with the physical…

Galvatron
- 59
- 1
- 2
4
votes
1 answer
How to change drive letter from command prompt or powershell in windows
I wants to change my computer disk D:\ to E:\ from command prompt or powershell. Is there any way other than 'diskpart'?

ReshmaA
- 85
- 1
- 3
- 12