datachain icon indicating copy to clipboard operation
datachain copied to clipboard

Copy command seems not working

Open dmpetrov opened this issue 8 months ago • 2 comments

Description

# Copy a file
$ datachain cp test.py gs://mpii-human-pose/test.py

# No files:
$ datachain ls --update gs://mpii-human-pose/ | grep test

# But:
$ datachain cp test.py gs://mpii-human-pose/test.py
Error: Path already exists: gs://mpii-human-pose/test.py

🤷‍♂

Version Info


dmpetrov avatar Apr 01 '25 20:04 dmpetrov

@dmpetrov I assume you want to copy local file to cloud bucket, but this is not something we support in cp at the moment. It only allows copying files from cloud to local directory.

What happens in your example is on first command test,py is seen as "source" and gs://mpii-human-pose/test.py is seen as local directory destination and you end up creating gs:///mpii-human-pose/test.py in your working directory. Second command lists actual bucket and there is no test.py in it, as expected. Third command tries to do the same as first one but that directory path ( gs:///mpii-human-pose/test.py) with file already exists locally.

Should we create new issue to implement copy from local to cloud?

ilongin avatar Apr 04 '25 10:04 ilongin

@ilongin thank you for the explanation! Let's keep it open for now. We might need some simple shortcuts anyway like download() and upload() and implement a proper cp later.

dmpetrov avatar Apr 04 '25 16:04 dmpetrov