Delphi Tips 
-----------------------------

0240  D1   D2   D3   D4   D5   D6   D7   3.1   95   98    作成: 1999/09/08 osamu rev 1.1
   B1   B3   B4   B5   B6   B7   NT3   NT4   2K   XP  更新: 1999/09/08 osamu 編集
任意のドライブをセクタ単位で読み書きする

Q:
MS-DOS Ver.2.1でフォーマットされたFDをWin95で読込みたいのですが、どのようにすればよいのでしょうか?
セクタ単位で読込む方法が解りません。

A:
'\\.\A:' で該当のドライブ( A: の部分を適宜変更)に対して CreateFile() すればアクセスできます。

# You can use the CreateFile function to open a disk drive
# or a partition on a disk drive. The function returns a
# handle to the disk device; that handle can be used with
# the DeviceIOControl function. The following requirements
# must be met in order for such a call to succeed:
#
# The caller must have administrative privileges for the
# operation to succeed on a hard disk drive.
# The lpFileName string should be of the form \\.\PHYSICALDRIVEx
# to open the hard disk x. Hard disk numbers start

注意として GetDiskFreeSpace() でセクタサイズを調べて FILE_FLAG_NO_BUFFERING でアクセスしてください。
参照: [Delphi-ML:32482] <ファイル>

[新規作成] [最新の情報に更新]

How To
Lounge
KeyWords


Tips
Delphi
Home
Osamu Takeuchi osamu@big.or.jp