Salut,
comment je pourrai accéder a la FAT d'une disquette (contenant des informations telles que la date de création, de derniere modification, le type de la diquette...), en VC++
merci d'avance pour votre aide
Salut,
comment je pourrai accéder a la FAT d'une disquette (contenant des informations telles que la date de création, de derniere modification, le type de la diquette...), en VC++
merci d'avance pour votre aide
Tu peux utiliser la fonction stat() pour avoir certaines informations. Sinon tu peux également ouvrir directement ta partition avec un open(). C'est ce que je fais pour savoir quel type de FAT je suis en train de lire.
Zero
My site : http://blog.lecacheur.com
GWhere project : http://www.gwhere.org
Debian Addict site : http://www.debianaddict.org
Avec visual tu dois :
faire un createfile avec comme paramétre :
"\\.\A:"
puis envoyer une ioctl :
DeviceIoControl avec :
(tiré du msdn)
DISK_IOCTL_READ
Block device drivers respond to this I/O control code in order to service FAT file system requests to read data from the block device.
Parameters
hDevice
Handle to the block device.
dwIoControlCode
DISK_IOCTL_READ.
lpInBuffer
Address of a SG_REQ structure..
nInBufferSize
Size of a SG_REQ structure.
lpOutBuffer
Not used.
nOutBufferSize
Not used.
lpBytesReturned
Address of a DWORD to receive total bytes returned.
lpOverlapped
Not used.
Return Values
When this function returns, the FAT file system expects the sr_status member of the SG_REQ structure to be set to either ERROR_SUCCESS if the read succeeded, or a standard Win32 error code otherwise. Certain errors are automatically retried, such as ERROR_BAD_UNIT if the device has been removed and ERROR_NOT_READY if the driver is in the process of shutting down or starting up. Block device drivers should return ERROR_GEN_FAILURE for any unknown or unexpected errors.
Remarks
The FAT file system fills in the SG_REQ structure passed to the block device driver as follows:
sr_start
Starting block number.
sr_num_sec
Number of blocks to read.
sr_num_sg
Number of scatter/gather buffers (normally 1).
sr_callback
NULL.
sr_sglist[0].sb_buf
Address of the buffer to read blocks into. Note that this buffer is unaligned.
sr_sglist[0].sb_len
Size of the sr_sglist[0].sb_buf buffer in bytes.
If sr_num_sg is greater than 1, then the block device driver should fill in additional entries in the sr_sglist array.
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager