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

Eilert eilert-sprachen at ...221...
Mon Apr 25 13:01:13 CEST 2005


Hi Tom,

Tom schrieb:
> Hi,
> 
> Just wondering if there is a function for checking if a file or folder exists? 

Yes, there is "exist()", so just

IF Exist("Your/Path") THEN


> And also if it is possible to find out if the user has actual permssions to 
> write within the folder.

Well, there is a "file" class which might help. Look it up in the help 
under "gb" and "File". The "stat()" thing might also help.

> 
> 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.

Doesn't the ready-made dialog for folders care about that already? Hm, I 
just typed in "dialog" in the help and got two "dialog" entries. The 
second one might help you a bit.

But there is also a "FileSizeProgram" in the list which may be of use 
for you.

Rolf





More information about the User mailing list