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
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
>
> 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
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
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
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
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
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
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
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'
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
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
>
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
13 matches
Mail list logo