matthewst
(Getting the hang of it)
2006-11-16 02:37 PM
How do I "do until" a folder exists?

I was finaly able to get the HTML script to generate the proper code. Thanks everyone!!

Now on to a problem I thought I had already solved.

The HTML document is to be placed into a folder that will not always be there. It's generated by an ancient program that we still have to use. I tried using @pid but that doesn't work because the folder isn't there when the program start but is generated at a later time. I'm thinking I can have a do loop until the folder appears then execute the script. Will that work? How do I do that?
 
[Subject name modified by NTDOC due to typo]


Mart
(KiX Supporter)
2006-11-16 03:20 PM
Re: How do I "do until" a floder exists?

How about this?

Code:

Break on
;
While Exist("c:\somefolder") <> 1
Sleep 60
Loop
;
?"Folder exists."
?"Starting an other script."
Call "c:\somescript.kix"



[edit]
Made a typo. Fixed that.
[/edit]


Mart
(KiX Supporter)
2006-11-16 05:03 PM
Re: How do I "do until" a floder exists?

BTW: @PID returns the process ID of kix32 or wkix32 and not a process ID for an other application.

matthewst
(Getting the hang of it)
2006-11-16 05:47 PM
Re: How do I "do until" a floder exists?

Got it to work like this:
Do sleep 6
Until Exist("C:\directory") <> 0

Thanks for all your help.


LonkeroAdministrator
(KiX Master Guru)
2006-11-16 06:59 PM
Re: How do I "do until" a floder exists?

like this?
doesn't look any different from the original.


Mart
(KiX Supporter)
2006-11-17 09:41 AM
Re: How do I "do until" a floder exists?

There are lots of ways to get you where you want to be.

NTDOCAdministrator
(KiX Master)
2006-11-17 10:27 AM
Re: How do I "do until" a FOLDER exists?

Like this?


Dim $Folder
$Folder = 'C:\Temp\MyTest'
Do
Sleep 1
'Waiting for creation of ' + $Folder ?
Until GetFileAttr($Folder) & 16
'The folder ' + $Folder + ' now exists' ?


Mart
(KiX Supporter)
2006-11-17 10:35 AM
Re: How do I "do until" a FOLDER exists?

Even beter.
This also deals with files with the same name as the folder is supposed to have.
Was thinking about doing that in my first post but I’m feeling lazy this week (thank god I'm leaving for a small vacation next week) and I’m low on silver platters