Sha256: 58e1f00ce5ad3520e774fe6d9892931a8f2f12b670d50271b028f97f0c91e60d

Contents?: true

Size: 810 Bytes

Versions: 5

Compression:

Stored size: 810 Bytes

Contents

from openc3.utilities.string import formatted
import tempfile

put_target_file("INST/test.txt", "this is a string test")
download_file("INST/test.txt")
file = get_target_file("INST/test.txt")
print(file.read())
file.close()  # closing deletes tempfile
delete_target_file("INST/test.txt")

save_file = tempfile.NamedTemporaryFile(mode="w+t")
save_file.write("this is a Io test")
save_file.seek(0)
put_target_file("INST/test.txt", save_file)
save_file.close()  # Delete the tempfile
file = get_target_file("INST/test.txt")
print(file.read())
file.close()
delete_target_file("INST/test.txt")

put_target_file("INST/test.bin", b"\x00\x01\x02\x03\xFF\xEE\xDD\xCC")
download_file("INST/test.bin")
file = get_target_file("INST/test.bin")
print(formatted(file.read()))
file.close()
delete_target_file("INST/test.bin")

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
openc3-cosmos-demo-5.17.1 targets/INST2/procedures/target_file.py
openc3-cosmos-demo-5.17.0 targets/INST2/procedures/target_file.py
openc3-cosmos-demo-5.16.0 targets/INST2/procedures/target_file.py
openc3-cosmos-demo-5.15.2 targets/INST2/procedures/target_file.py
openc3-cosmos-demo-5.15.1 targets/INST2/procedures/target_file.py