Login Page - Create Account

Support Board


Date/Time: Sat, 18 Jan 2025 19:36:45 +0000



[Programming Help] - ACSIL - Creating a new directory

View Count: 784

[2018-02-25 20:23:39]
Zosimus - Posts: 345
What is the way to create a new folder/directory from an ACSIL code?

At the moment I use the Windows API CreateDirectory() function but I'm getting comiling errors.
The code I use is:

CreateDirectory(L"\\LV3_Folder", NULL);

the window API is included of course.

The compiling error - cannot convert 'const wchar_t*' to 'LPCSTR {aka const char*}' for argument '1' to 'WINBOOL CreateDirectoryA(LPCSTR, LPSECURITY_ATTRIBUTES)'
CreateDirectory(L"\\LV3_Folder", NULL);
[2018-02-25 23:31:13]
Sierra Chart Engineering - Posts: 104368
You need to remove the L in front of the text string unless you call CreateDirectoryW instead.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-02-25 23:31:53
[2018-02-26 00:28:00]
Zosimus - Posts: 345
Yes, this solved the compiling error and the build succeeded but no new directory is created when I run the dll.
(the dll itself works properly so I see no reason for the createdirectory() not to work).
using
CreateDirectory("\\LV3_Folder", NULL);
I expect to see a "LV3_Folder" directory in the data folder.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account