[Gambas-user] Checking if a folder/file exists

fabien gambasfr at ...11...
Mon Apr 25 14:56:01 CEST 2005


Le Mardi 26 Avril 2005 01:42, Tom a écrit :
> Hi,
>
> Just wondering if there is a function for checking if a file or folder
> exists? And also if it is possible to find out if the user has actual
> permssions to write within the folder.
>
> Reason for this is that I am developing a program which may require the
> user to create a new folder, and if the user types a folder path that
> doesnt exist then obviously I'll get problems.
>
> I am just using a String for the path of the folder not the File class.
>
> Can anyone give me any suggestions? Thanks!
>
> Tom
>
>

you can look at the ide code in the Fsupselector.class

You have the if Exist(path as string) then

and you can do a test like :

Function TestAccess(sPath as string) as Boolean
dim s as new String[]
 
 s = Dir(sPath)
 return true

catch

 return false
end

Fabien





More information about the User mailing list