ioBroker / ioBroker.js-controller

ioBroker controller
http://iobroker.net
MIT License
294 stars 58 forks source link

[enhancement]: CLI "append to file" #2584

Open klein0r opened 9 months ago

klein0r commented 9 months ago

No existing issues.

Description

At the moment it is possible to upload new files via CLI:

$ iobroker file --help
iobroker file

File management

Commands:
  iobroker file read <iobroker-path-to-read> [<filesystem-path-to-write>]  Read file from iobroker path and optionally write to destination
  iobroker file write <filesystem-path-to-read> <iobroker-path-to-write>   Read file from path and write it to iobroker path
  iobroker file rm <iobroker-path-to-delete>                               Remove file
  iobroker file sync                                                       Sync files

Options:
  --help  Show help  [boolean]

e.g.

mkleine@iobroker:~$ echo "test" > ~/test.txt 
mkleine@iobroker:~$ iobroker file write ~/test.txt 0_userdata.0/test.txt
File "/home/mkleine/test.txt" stored as "test.txt"

But it is not possible to append content to a file (like >> in bash)

Why?

e.g. to append lines to a csv file

How?

iobroker file append "hello;1;2;3" 0_userdata.0/data.csv
Apollon77 commented 9 months ago

Can ylu elaborate more on the usecase for it? Because also append only makes sense for text files

foxriver76 commented 9 months ago

Admin has nice possibilities to modify text files manually for doing stuff programmatically we also have the API. Would of course be possible to add but probably only a handful of people would use this like once^