❔ How to deal with paths and file system files in a Win/Linux cross platform NET 6 application?
I am working with a cross-platform application (Linux & Windows) that requires a plethora of configuration files and performs a lot of file IO during execution in locations typically under the installation folder. I would like to know, at a high level, how the configuration files, the paths utilized in the code (some hardcoded & some dynamically created), and permissions are best to be maintained in the product code. This is an application that just now is implementing Linux support.
A pain point is that the installation & configuration locations in Windows are different than those on Linux. My thinking is that I would like to have these paths configured somewhere as strings, but load the correct set based on the platform at runtime. However, I do not know whether these is a configuration that facilitates this setup in .NET or whether this is an effective approach.
I am looking for high level recommendations and suggestions on how to deal with file system artifacts as current pain points include:
1. Errors while creating/reading files due to permissions not being set correctly on the files or folders created at runtime
2. Bogus file system folders and files being created when a file path contains spaces and subsequent errors while opening them
3. Subprocesses not starting correctly due to location resolution errors
A pain point is that the installation & configuration locations in Windows are different than those on Linux. My thinking is that I would like to have these paths configured somewhere as strings, but load the correct set based on the platform at runtime. However, I do not know whether these is a configuration that facilitates this setup in .NET or whether this is an effective approach.
I am looking for high level recommendations and suggestions on how to deal with file system artifacts as current pain points include:
1. Errors while creating/reading files due to permissions not being set correctly on the files or folders created at runtime
2. Bogus file system folders and files being created when a file path contains spaces and subsequent errors while opening them
3. Subprocesses not starting correctly due to location resolution errors
