dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual Basic
Expertise: Intermediate
Apr 6, 2000

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Determine the File System Type

With the advent of the FAT32 file system, you might want to use VB to determine the type of file system being used for a particular drive. This example is set for the C drive; change the variable sDrive to test other drives. Run this routine; the variable sResult contains the file system name string:
 
Private Declare Function GetVolumeInformation _
	Lib "kernel32" Alias "GetVolumeInformationA" _
	(ByVal lpRootPathName As String, ByVal _
	lpVolumeNameBuffer As String, ByVal _
	nVolumeNameSize As Long, _
	lpVolumeSerialNumber As Long, _
	lpMaximumComponentLength As Long, _
	lpFileSystemFlags As Long, ByVal _
	lpFileSystemNameBuffer As String, ByVal _
	nFileSystemNameSize As Long) As Long
Public Function WhichFileSystem(ByVal Drive _
	As String) As String
	Dim sVolBuf As String * 255
	Dim sSysName As String * 255
	Dim lSerialNum As Long
	Dim lSysFlags As Long
	Dim lComponentLength As Long
	Dim lRes As Long
	lRes = GetVolumeInformation(Drive, sVolBuf, _
		255, lSerialNum, lComponentLength, _
		lSysFlags, sSysName, 255)
	If lRes Then
		WhichFileSystem = Left$(sSysName, _
			InStr(sSysName, Chr$(0)) - 1)
	Else
		WhichFileSystem = "<unknown>"
	End If
End Function
Dan Verkade
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date