GRV-EPIC-PR1 File Write to non-existent folder

Hello,
We are in the process of porting over a strategy from the PAC R1 to the GRV-EPIC-PR1 and we are having a problem with the OpenOutgoingCommunication command. Previously when a handle was opened to write to a file any directories that did not exist would be created. For example, if we had started with a blank SD Card and created a handle “file:w,/sdcard0/logs/2019/11/logfile.txt” it would create the “logs”, “2019”, and “11” directories.

Now on the GRV-EPIC-PR1 controller, if we tried doing the same thing with a string of “~/unsecured/logs/2019/11/logfile.txt” we receive a -407 error. I can however write to an existing directory such using “~/unsecured/logfile.txt”. Is there a problem with the SoftPAC application running on the PR1.

The controller is running firmware version 1.5.0-b.42 and we are creating the strategy using PAC Control Professional Version 10.2a. Also, the Shell license is installed on this controller.

Thanks

Hi John, welcome to the forums!

Unfortunately the Linux file system on EPIC is not as ‘forgiving’ as the operating system on the PAC R1.
This means exactly what you have found, it will not auto-create the missing directories for you.
For what its worth, SoftPAC on Windows is exactly the same.
You will need a little more code to create the directory at the start of each month.
(Since you have shell, you could use a cron job to run a shell/bash script to do that for you?).

1 Like

Thanks for the welcome and quick reply!

I would recommend to Opto that they update the Form 1700. It currently states the path is created if it does not exist for the EPIC controllers.
You can use the following formats only for groov EPIC processors. The ~ mark indicates the home directory of the private area:
• ~/filename.extension—The file is stored or located in the home directory of the private area.
• ~/path/filename.extension—If the path does not exist, it is created. The path and file are stored or
located from the home directory of the private area.
• ~/unsecured/filename.extension—The file is stored or located off the root directory of the unsecured
area, where control programs and PAC Control strategies can access it

It would be nice in future releases if they put that capability back in :grin:

Thanks again

Thanks for the doc’s tip. Always appreciate it when our users are reading the manual!
Will pass it on to the docs team.

And yes, a ticket has been submitted for the software engineers to see if we can do the dirty work of creating the missing directory for the user as part of the file handle call.