Skip to content

Commit f6437f0

Browse files
committed
fix cp bug when container exists but there are no blobs with the same prefix
1 parent 5d453de commit f6437f0

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "AzStorage"
22
uuid = "c6697862-1611-5eae-9ef8-48803c85c8d6"
3-
version = "2.6.3"
3+
version = "2.6.4"
44

55
[deps]
66
AbstractStorage = "14dbef02-f468-5f15-853e-5ec8dee7b899"

src/AzStorage.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ cp(AzContainer("mycontainer";storageaccount="mystorageaccount"), "remoteblob_in.
749749
```
750750
"""
751751
function Base.cp(in::AbstractString, outc::AzContainer, outb::AbstractString; buffersize=2_000_000_000, show_progress=false)
752-
if !isdir(outc)
752+
if !iscontainer(outc)
753753
error("output container '$outc' does not exist. use `mkpath to create it.")
754754
end
755755

test/runtests.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,17 @@ end
514514
rm("foolocal.txt")
515515
end
516516

517+
@testset "Container, copy local file to blob, with prefix" begin
518+
write("foolocal.txt", "Hello world")
519+
r = uuid4()
520+
c = AzContainer("one/two/three/four/foo-$r-o", storageaccount=storageaccount, session=session, nthreads=2, nretry=10)
521+
robust_mkpath(c)
522+
cp("foolocal.txt", c, "foo.txt")
523+
@test read(c, "foo.txt", String) == "Hello world"
524+
rm(c)
525+
rm("foolocal.txt")
526+
end
527+
517528
@testset "Container, copy large local file to blob" begin
518529
n = 100
519530
x = rand(UInt8, n)

0 commit comments

Comments
 (0)