Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 18:46:39 +0000



Post From: Working example code to read a cvs file.

[2024-01-08 23:38:27]
User719512 - Posts: 263
This is a programming question, and I believe Sierra does not answer programming questions.

You mention deleting the file as part of your workflow Ticks, how are you going to do that? Sierra does not have a sc.DeleteFile() function?

That said...Sierra study code is c/c++ code and you can use Win32 API and std libraries/etc. So if you (or others) need to learn this, you can search or use ChatGPT to guide you.

Assuming you will also want to control file locking and exclusive write access from Ninja in your c# code, and handle the same for Sierra to open and read with the file locked to prevent Ninja from overwriting your data while processing. Checking if the file exists is a poor pattern. A better pattern is to try to open the file with the access you need. If it succeeds, great. If not, that could fail for many reasons and the code should fail gracefully.

I use many calls from these std libraries in Sierra

#include <iostream>
#include <sstream>
#include <locale>
#include <filesystem>

namespace fs = std::filesystem;
using namespace std;

You might know these libraries already, or you (or others reading this) may not. This will be part of the journey to writing your studies and making them robust, reliable, and performant.