[Gambas-user] Checking whether a file exists

Fabien Bodard gambas.fr at ...626...
Tue Jul 12 17:44:50 CEST 2011


2011/7/12 tobias <tobiasboe1 at ...20...>:
> hi,
>
> in a project, i am searching directories recursively and opening files
> to search their content, too.
> while searching in the gambas2 sources my program crashed with "File or
> directory doesn't exist". so i noticed this one
>
> ? sFile
> ".../main/ltmain.sh"
> ? Exist(sFile)
> True
> ? File.Load(sFile)
> File or directory does not exist
>
> this is because the file is a symlink to another file that doesn't exist
> (maybe because i haven't compiled gambas2 from sources yet), so Exist
> says the file is there but when opening it, the symlink is resolved and
> there is an error.
> this may be irritating.
>
> developers, do you think it's necessary to do something here? (maybe
> Exist(sPath AS String, bFollowSymlinks AS Boolean) ?)
>
> regards,
> tobi
I think it's a good idea... stat already do that
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Fabien Bodard




More information about the User mailing list