You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This command would be much easier to use in many cases if it had the option to block execution until a file has been selected and loaded. That way, if a script needs to perform on the file, it will know exactly when it's able to do so.
It would also be helpful to be able to retain the file's name. It could work like cp, mv, etc: if you provide the path to a directory, it will place the file in that directory with its original name. If you provide the path to a file, it would create or overwrite that file.
I have a rough version of this working. If anyone's interested I can clean up the code and publish it.
The text was updated successfully, but these errors were encountered:
Even better IMHO would be if that command only returned a path to selected file (or directory) and user in his bash script could do the rest - moving, copying, creating, removing etc.
@setaur Good idea, but from my understanding that's only possible for files in external storage. In other cases (e.g. app-specific internal data or Google Drive files) you don't actually have direct read/write access to the file, but the system provides an inputstream to let you read it indirectly.
So to keep the command flexible, perhaps it could have the option to return the file path if it's accessible or copy it to the specified location otherwise.
What termux-storage-get might do to address @setaur's request is to have several modes of output determination:
Fixed output location -- as it is
Output to a directory with its original file name (suffixed if that file exists, or explicitly overwriting), and print the new file name on stdout -- what @cvirostek is suggesting
Output to a (possibly temporary) directory with its original file name, or just the original file name if that file has a physical representation on disk and that is accessible to the caller (both of which might be quite tricky to determine) -- as suggested by @setaur.
At any rate, the last item is in my impression only feasible to address once the second is working.
This command would be much easier to use in many cases if it had the option to block execution until a file has been selected and loaded. That way, if a script needs to perform on the file, it will know exactly when it's able to do so.
It would also be helpful to be able to retain the file's name. It could work like
cp
,mv
, etc: if you provide the path to a directory, it will place the file in that directory with its original name. If you provide the path to a file, it would create or overwrite that file.I have a rough version of this working. If anyone's interested I can clean up the code and publish it.
The text was updated successfully, but these errors were encountered: