How to read bytes from a device using c/c++ in windows

拜拜、爱过 提交于 2019-12-10 11:58:56

问题


So here's the background:

I've got this SCSI device with media that has raw data on it (for simplicity let's say it contains abc123). This device is on a Windows machine. I'd like to use C/C++ to initalize the device, open it, send the SCSI read command to the device, and ultimately "read" the bytes.

I've searched for similar topics, but I keep getting Linux/Unix guides, or Visual C++ (which I do not have access to).

Does anyone know a good way to start this? Maybe some sample code or maybe someone has a tutorial laying around ;-)

Thank you in advance!

EDIT: I am using Cygwin.


回答1:


If you absolutely must go down to the hardware level and as far as linux is concerned you would have to use IOCTL commands, for example: http://sg.danny.cz/sg/sg_io.html




回答2:


UPDATE: After banging my head into a wall for quite some time, and some pleading and begging, I managed to get my superviser to allow me to get Visual Studio 2003 installed!

To anyone looking for more information on this topic, I highly agree with the comments provided above-it's near impossible to accomplish this on a Windows machine and not use Visual C++.

My only other suggestion is to make the wonderful switch to *nix world (if you can)!



来源:https://stackoverflow.com/questions/9946795/how-to-read-bytes-from-a-device-using-c-c-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!