Modify

Opened 14 years ago

Closed 14 years ago

#1857 closed Bug (Fixed)

DriveGetFileSystem not returning expected result when no media loaded

Reported by: GEOSoft Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: DriveGetFileSystem, Docs, Return Value Cc:

Description

According to the help file a drive with no media should return the numeric 1 but returns an empty string instead.

$aDrives = DriveGetDrive("cdrom")
If NOT @Error Then
	For $Drive in $aDrives
		If IsNumber($Drive) Then ContinueLoop
		MsgBox(0, "Result", StringUpper($Drive) & @CRLF & DriveGetFileSystem($Drive & "\"))
	Next
EndIf

Tested on DVD-RW drives if it makes a difference. The trailing back slash was only added to see if it made any difference.

Also the For/In loop used in this code builds a good case for using all 0 based arrays then we don't have to check the first element for IsNumber() and numeric arrays could be used.

Attachments (0)

Change History (2)

comment:1 Changed 14 years ago by GEOSoft

I should have added that there is a not so pretty work around for this issue but it really shouldn't be required in my opinion.
I also didn't mention that it was tested on Vista only.

$aDrives = DriveGetDrive("cdrom")
If NOT @Error Then
	For $Drive in $aDrives
		If IsNumber($Drive) OR DriveStatus($Drive) <> "ready" Then ContinueLoop
		MsgBox(0, "Result", StringUpper($Drive) & @CRLF & DriveGetFileSystem($Drive & "\"))
	Next
EndIf

comment:2 Changed 14 years ago by Jon

  • Resolution set to Fixed
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.