[Gambas-user] How to avoid second instance?
ron
ronstk at ...239...
Thu Sep 16 10:08:02 CEST 2004
On Thursday 16 September 2004 08:58, Eilert wrote:
> Hi Alberto,
>
> this is my solution - it does not contain IsDir() yet because Ron's mail
> came too late :-)
>
> There is some German in it:
>
> datei = file
> pfad = path
> dtnr = file number
> laeuft = is running
>
> One could make the second "FOR EACH..." somewhat shorter by using
> IsDir(), but unfortunately there is no IsFile(), so the first "FOR
> EACH..." will have to stay I guess.
>
> I've built it into one of my projects and it runs perfectly this way.
>
> Rolf
What exactly else can it be if not is a Directory?
IF IsDir("/home/Alberto/fantasyname") THEN
'i'm a directory
ELSE
'I'm gues what?
'file, symlink
ENDIF
See GAMBAS.Sta
Stat
File info = Stat ( Path )
Returns information about a file or a directory as a
File object: type, size, last modification time, permissions...
if Stat(pfad).Type = gb.Directory then
if Stat(pfad).Type = gb.File then
if Stat(pfad).Type = gb.????? ' see constants in help gb.gb !
More information about the User
mailing list