Re: [Gambas-user] Try Catch fail when using mkdir....

2011-07-02 Thread Fabien Bodard
gt; -- Original Message --- > From: Rolf-Werner Eilert > To: gambas-user@lists.sourceforge.net > Sent: Fri, 01 Jul 2011 10:21:31 +0200 > Subject: Re: [Gambas-user] Try Catch fail when using mkdir > >> Hi Stephen, >> >> my first thought was that it

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-07-02 Thread Fabien Bodard
sorry i've done it directly without gambas ... the correction : private sub CreateDirTree(sDir as string) dim s as string if sdir begins "/" then sdir = right(sdir,-1) For each s in split(sDir, "/") sDir &/= s if exist(stmpdir) then continue mkdir stmpdir next catch Print "The dire

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-07-01 Thread Jussi Lahtinen
> > End > > -Fernando > > > > > > -- Original Message --- > From: Rolf-Werner Eilert > To: gambas-user@lists.sourceforge.net > Sent: Fri, 01 Jul 2011 10:21:31 +0200 > Subject: Re: [Gambas-user] Try Catch fail when using mkdir > > &g

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-07-01 Thread Stephen Bungay
Greetings Fabien! That works very well, and is so much smaller and cleaner than the SUB you put in the initial email. By the way, that first SUB would have had a problem creating the stmpDir folder, it would, as written, not put in the delimiting "/" characters and would try to create a d

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-07-01 Thread nando
vate Sub CreateNewOutputFolder(psFolderSpecification As String) TRY MKDIR File.Path(psFolderSpecification) End -Fernando -- Original Message --- From: Rolf-Werner Eilert To: gambas-user@lists.sourceforge.net Sent: Fri, 01 Jul 2011 10:21:31 +0200 Subject: Re: [Gambas-user] Try Catch f

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-07-01 Thread Fabien Bodard
This is the good way in your way ... but it's a bad way in my fill Private Sub CreateNewOutputFolder(sFolderSpec As String) If Not Exist(sFolderSpec) Then Mkdir sFolderSpec Catch 'if problem try on the prec folder CreateNewOutputFolder(File.Dir(sFolderSpec)) 'Re Try the folder cre

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-07-01 Thread Rolf-Werner Eilert
Hi Stephen, my first thought was that it might be If Not Exist... I had such a case some time ago, and it did not react as expected. Just check if it really reports TRUE if the directory isn't there. (I remember Benoit explained why it didn't run correctly in my case, maybe you find the thread

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-06-30 Thread Stephen Bungay
Typo in the Finally section... "Exists(sFolderSpec)" should read "Exist(sFolderSpec)". On 06/30/2011 11:58 PM, Stephen Bungay wrote: > Hi Fabien& Tobias; > > Thanks for taking the time to reply and putting those SUBs together. > Another way to do this is to simply execute a "mkdir -p

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-06-30 Thread Stephen Bungay
Hi Fabien & Tobias; Thanks for taking the time to reply and putting those SUBs together. Another way to do this is to simply execute a "mkdir -p " using the command shell, but now that the problem exists I want to figure out why the recursive routine is not behaving as expected. Fabi

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-06-30 Thread Fabien Bodard
private sub CreateDirTree(sDir as string) dim s as string dim stmpDir as string = "/" if sdir begins "/" then sdir = right(sdir,-1) For each s in split(sDir, "/") stmpDir &= s if exist(stmpdir) then continue mkdir stmpdir next catch Print "The directory " & stmpdir & "can'

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-06-30 Thread Fabien Bodard
The FINALLY part is not mandatory. If there is a catch part in the function, the FINALLY part must precede it. http://gambasdoc.org/help/lang/finally The second call will be in the catch part not in finally. 2011/6/30 Stephen Bungay : > Hi folks! > > Gambas 2.99 > Fedora 14 > >   Using mkdir wit

Re: [Gambas-user] Try Catch fail when using mkdir....

2011-06-30 Thread tobias
hi, > Hi folks! > > Gambas 2.99 > Fedora 14 > >Using mkdir with "catch" and "finally" to create a recursive SUB to > build a directory structure. >The harness consists of FormMain with one big-friendly button on it, > pretty simple. Here is all of the code; > > ' Gambas class file >

[Gambas-user] Try Catch fail when using mkdir....

2011-06-30 Thread Stephen Bungay
Hi folks! Gambas 2.99 Fedora 14 Using mkdir with "catch" and "finally" to create a recursive SUB to build a directory structure. The harness consists of FormMain with one big-friendly button on it, pretty simple. Here is all of the code; ' Gambas class file Public Sub _new() End Publi