nasa / fprime

F´ - A flight software and embedded systems framework
https://fprime.jpl.nasa.gov
Apache License 2.0
10.05k stars 1.3k forks source link

fprime-gds: file downlink removes leading directories #2658

Open timcanham opened 6 months ago

timcanham commented 6 months ago
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

  1. Downlink a file with a destination with a directory path
  2. 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 6 months ago

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: