The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Check and create directory
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tib

Switzerland
105 Posts

Posted - 10/08/2003 :  1:45:05 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

tib

Switzerland
105 Posts

Posted - 10/14/2003 :  3:15:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 10/14/2003 :  3:40:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

tib

Switzerland
105 Posts

Posted - 10/15/2003 :  02:19:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000