[Gambas-user] Creating a directory

Grahame White grahame at ...457...
Mon May 31 14:43:09 CEST 2004


On Monday 31 May 2004 12:56, Benoit Minisini wrote:
> On Monday 31 May 2004 13:48, Grahame White wrote:
> > Currently I have a section of code something like this
> >
> > dim path as string
> >
> > path = "/home/" & application.user & "/.gbdir"
> >
> > if exist(path) then
> > 	' do stuff
> > else
> > 	mkdir path
> > endif
> >
> >
> > So basically is the directory there, if not make it.
> >
> > However all I'm getting is a file/directory doesn't exist error
> > message popping up. Well duh of course it doesn't that's why I'm
> > trying to create it :/
> >
> > Any ideas?
> >
> > Grahame
>
> You must be more precise if you want any help.
>
> Which error number did you get? 
There is no error number, just "file or directory does not exist"

> Which line raises the error?
the "mkdir path" line raises the error (found be using the dubugger to run 
lin by line)

> Which code did you write in "'do stuff"?
Doesn't matter as that section is not entered. It's not entered because the 
directory be tested for, /home/grahame/.gbdir, doesn't exist. I have 
confirmed this by tracing the path of execution with the gambas dubugger.

> What is the value of Application.User?
grahame

print path shows /home/grahame/.gbdir

> And so on... 


Grahame




More information about the User mailing list