Get_Directory

See Also: File I/O Commands, File_Exist, Make_Directory, Make_Temp_File, Remove_Directory, Valid_Drive

Purpose

To obtain the current working folder for a given drive letter.

Syntax

Get_Directory [{drive}]  {variable}

where:

What It Does

Get_Directory returns the current working folder in {variable} for a given drive.

Example

This sample shows how to get current folders for all valid drives.

String sFolder

Integer i  // Counter for all drives.

Integer bInvalidDrive

 

// Retrieve the current folder.

For i From 65 To 90 // A to Z

    // Check if drive is OK.

    // Note: Can still have a media not ready error.

    Valid_Drive (Character(i)) bInvalidDrive

    If (Not(bInvalidDrive)) Begin

        Move "" to sFolder // Reset the value

        Get_Directory (Character(i)) sFolder

        Showln "Current folder for drive " ;

               (Character(i)) " is " sFolder

    End

Loop

Notes