Can anyone poinmt in the direction of some documentation of working with the floppy drive.
Stuff like: amount of space left on floppy, directories and files on floppy etc.
T'anx :p
Printable View
Can anyone poinmt in the direction of some documentation of working with the floppy drive.
Stuff like: amount of space left on floppy, directories and files on floppy etc.
T'anx :p
I guess that would be the same as with a harddrive.
With the exception of "Is the floppy ready?" all of the api stuff for drives works just fine with a floppy drive.
VBNET has a bunch of code for getting all this stuff - search on 'floppy drive' and you'll get about 60 code samples.;)
It should be no different from a hdd.
Code:'In general section
Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long
Private Sub Form_Load()
Dim Sectors as Long,Bytes as Long,FreeC as Long, TotalC as Long,Total as Long,Freeb as Long
'Retrieve information about the C:\
GetDiskFreeSpace "C:\", Sectors, Bytes, Freec, Totalc
'Set graphic mode to persistent
Me.AutoRedraw = True
'Print the information to the form
Me.Print " Path: C:\"
Me.Print " Sectors per Cluster:" + Str$(Sector)
Me.Print " Bytes per sector:" + Str$(Bytes)
Me.Print " Number Of Free Clusters:" + Str$(Freec)
Me.Print " Total Number Of Clusters:" + Str$(Totalc)
Total = rTotalc& * rSector& * rBytes&
Me.Print " Total number of bytes in path:" + Str$(Total)
Freeb = rFreec& * rSector& * rBytes&
Me.Print " Free bytes:" + Str$(Freeb)
End sub
Ups, sorry, here are the parameters
Code:· lpRootPathName
Points to a null-terminated string that specifies the root directory of the disk to return information about. If lpRootPathName is NULL, the function uses the root of the current directory.
· lpSectorsPerCluster
Points to a variable for the number of sectors per cluster.
· lpBytesPerSector
Points to a variable for the number of bytes per sector.
· lpNumberOfFreeClusters
Points to a variable for the total number of free clusters on the disk.
· lpTotalNumberOfClusters
Points to a variable for the total number of clusters on the disk.