VOLTTRON / volttron

VOLTTRON Distributed Control System Platform
https://volttron.readthedocs.io/
Other
461 stars 218 forks source link

Accessing files outside of a volttron agent #2909

Open lazlop opened 2 years ago

lazlop commented 2 years ago

I'm currently writing an agent that works with FMU files (using pyFMI), but I can't seem to access the FMU files. How can I allow a volttron agent to access a .fmu file by absolute path?

craig8 commented 2 years ago

This should be able to be done via the pathlib module.

from pathlib import Path

pth = Path('path').resolve(strict=True)  # strict resolves symlinks 

# this is now a Path object not a string if you need a string to pass to pyFMI you can use
str(pth)