Open
Description
Describe the issue
The following command should fail with a directory does not exist error:
databricks fs cp hello.txt dbfs:/Volumes/a/b/mydir/
if directory mydir does not exist. This would be consistent with how the Linux cp
works.
% cp 0.json tmp/
cp: directory tmp does not exist
Instead, this command creates a file called mydir with the contents of hello.txt.
Another option is to transparently create mydir. The Files API has the behaviour that it is supposed to create directories that don’t exist when uploading a file.
The cp should differentiate between whether the target is a file or a directory based on the trailing slash.
Is this a regression?
No