| Author |
Topic  |
|
|
tib
Switzerland
105 Posts |
Posted - 10/08/2003 : 1:45:05 PM
|
Hi there,
when I want to export a file (OGG, PDF, ...) with LabTalk I can check with the following command whether it already exists.
TMP=file.exist(Path\Filename); // 0=not found, 1=exist;
How can I check for a directory? And in case it doesn't exist how do I create it? My search for "create" and "directory" in the Origin LabTalk Help was unsuccessful so far. Do I have to use DOS commands? Something like run -e md NewDir???
Thanks for hints, Tilman.
|
|
|
Mike Buess
USA
3037 Posts |
Posted - 10/08/2003 : 5:32:48 PM
|
Hi Tilman,
If you have Origin 7 then all of that can be done with Origin C's CheckMakePath function. It tests for the existence of a path and creates all necessary folders if it doesn't. In Origin 6.1 or earlier the only way to find out if a directory exists is to look for a file within it. You need to know a file's name in order to look for it in Origin, so that can get messy. A DOS solution will work for creating a directory, but I don't remember if you can test for a directory's existence from DOS. Check out http://www.nmrtools.com/labtalk/dos.htm for some information about running DOS commands from Origin.
Hope that helps.
Mike Buess Origin WebRing Member |
 |
|
|
tib
Switzerland
105 Posts |
Posted - 10/14/2003 : 3:15:07 PM
|
Hi Mike, I have Origin7 and I am about slowly switching to OriginC... However, I could not find the syntax of your magic "CheckMakePath" function in the OriginC manual. Or is this your custom defined function? Thanks for your help & patience, Tilman.
|
 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 10/14/2003 : 3:40:52 PM
|
CheckMakePath is listed under Origin C Language Reference->Global Functions->File Management in 7.0 SR4. If you've already updated to SR4 you should Check for Updates again to get the new help files. Patches and updated Help files are supplied separately these days.
Mike Buess Origin WebRing Member |
 |
|
|
tib
Switzerland
105 Posts |
Posted - 10/15/2003 : 02:19:34 AM
|
OK, thanks Mike. I had the old help files. Strangely enough, you still cannot find CheckMakePath by searching for "CheckMake". You'll find it by searching for "Check". But anyway, it's there where you said with SR4 help. Thanks, Tilman.
|
 |
|
| |
Topic  |
|