File_DirExists()

… visits
Parent Previous Next

Syntax

File_DirExists(pFileName As Global_sFileName), Bit

Parameters

Parameter

Description

pFileName

The name of the directory to check (maximum length 8 characters).

Return status

Value

Meaning

0

Directory not found.

1

Directory found.

Overview

Check if Directory Exists

This procedure checks whether a directory with the given name exists. The directory name can be up to 8 characters in length.

Notes

Example

File_DirExists("MyFolder")

TftSetUp(0, 0)                                                                                 'Set screen

TftResetScreen(BLACK)                                                                       'Reset screen

TftSetSndFont(0,0)                                                                          'Set Font0

While File_Init() <> cErrOK : Wend                                                          'Initialize SD Card

TftPrintSndString("Sd Initialization OK",1,0,0,1,GREEN,BLACK,0)                             'Confirm Initialize SD Card

If File_Exists("bird.jpg") = 1 Then

TftPrintSndString("Exist bird.jpg OK",1,0,4,1,GREEN,BLACK,0)                            'bird.jpg exists (expected)

Else

TftPrintSndString("Exist bird.jpg NO",1,0,4,1,GREEN,BLACK,0)                            'bird.jpg not exists

EndIf

If File_Exists("test.log") = 1 Then

TftPrintSndString("Exist test.Log OK",1,0,5,1,GREEN,BLACK,0)                            'test.Log exists

Else

TftPrintSndString("Exist test.Log NO",1,0,5,1,GREEN,BLACK,0)                            'test.Log not exists (expected)

EndIf

If File_DirExists("home") = 1 Then

TftPrintSndString("Exist home OK",1,0,2,1,GREEN,BLACK,0)                                'home folder exists (expected)

Else

TftPrintSndString("Exist home NO",1,0,2,1,GREEN,BLACK,0)                                'home folder not exists

EndIf

If File_DirExists("tree") = 1 Then

TftPrintSndString("Exist tree OK",1,0,3,1,GREEN,BLACK,0)                                'tree folder exists

Else

TftPrintSndString("Exist tree NO",1,0,3,1,GREEN,BLACK,0)                                'tree folder not exists (expected)

EndIf

File_DirExists()File_DirExists()

Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's Documentation Tool