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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Only create folder if not exist

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
elquin Posted - 08/31/2017 : 04:25:48 AM
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...
1   L A T E S T    R E P L I E S    (Newest First)
Chris D Posted - 08/31/2017 : 3:11:05 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000