fprime-gds: file downlink removes leading directories
timcanham opened this issue · comments
Timothy Canham commented
F´ Version | v3.4.3 |
Affected Component | n/a |
Problem Description
Add destination directory back in some form. Having raw names can cause overwrites.
Context / Environment
Execute fprime-util version-check
and share the output.
(p3fprime) tcanham@MT-509434:~/source/fprime/Ref$ fprime-util version-check
Operating System: Linux
CPU Architecture: x86_64
Platform: Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Python version: 3.10.12
CMake version: 3.22.1
Pip version: 22.0.2
Pip packages:
fprime-tools==3.4.4
fprime-gds==3.4.3
fprime-fpp-*==2.1.0a5```
How to Reproduce
- Downlink a file with a destination with a directory path
- Look at file name. Is something like
._Foo.bar
Expected Behavior
Normalize the file path and create the directory path to retain directory separation. If it's not desirable to create directories, perhaps use a notation like dir_path_file
to preserve the separation.
Joshua Anderson commented
It's also not uncommon to downlink the same file multiple times, so it would be nice to support that to. (Ex. Run a sequence that generates a logfile)
What I might recommend is:
- Store downlinked files locally in the GDS as
<GDS_DL_TMP_DIR>/<random string>-<filename>
- In the HTML UI, show their filename as the full filepath
- When downloading, set the filename to be the normal filename