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
 Only create folder if not exist
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

elquin

Republic of Korea
7 Posts

Posted - 08/31/2017 :  04:25:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2015 (64bit) Sr2
Operating System: Windows 7

What will be the best way to create folder if not exist by Origin script?

Thank you in advance...

Chris D

428 Posts

Posted - 08/31/2017 :  3:11:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, we have a family of LabTalk callable X-Functions for interacting with folders in an Origin project (many have examples in documentation):

The one you specifically want is pe_mkdir:
http://www.originlab.com/doc/X-Function/ref/pe_mkdir

The others begin with "pe_" and are listed here:
http://www.originlab.com/doc/X-Function/ref/X-Functions-for-System

A handy method to determine if a folder already exists in a project is to use the exist() function in this manner:

if(exist(Run Data,25) == 0)
    pe_mkdir "Run Data"; 

That creates the folder if it does not already exist.

To learn more about this, see the end of this page:
http://www.originlab.com/doc/LabTalk/ref/Exist-func

BTW- The exist() function is a good function to know about in general.


Thanks,
Chris Drozdowski
Originlab Technical Support

Edited by - Chris D on 08/31/2017 3:11:59 PM
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