components-contrib icon indicating copy to clipboard operation
components-contrib copied to clipboard

Cross-platform temp directory for local storage binding

Open SoTrx opened this issue 1 year ago • 0 comments

The local storage binding is very useful in development scenarios where a cloud storage solution would be cumbersome. In these development scenarios, you may want to use the system temp directory.

However, there is currently no way to do this is in a cross-platform way. The local storage component currently has a single "rootPath" metadata.
To use the temp directory on Unix-based systems, rootPath can be set to "/tmp". On Windows, either the system-wide temp directory (C:\Windows\Temp) or the user-specific temp directory (C:\Users<User>\AppData\Local\Temp) can be used.

This may be a problem when sharing development environments between systems, especially in multi-app run scenarios.

To solve this, I'd like to suggest either adding a "fromTemp" boolean metadata that resolves rootPath from the system-wide tmp dir if true, and defaults to false (so as not to break any current deployments), or allowing the expansion of env variables in rootpath before creating the directory (but this may lead to unexpected behavior)

SoTrx avatar Sep 30 '23 14:09 SoTrx