# Error -146059294 in \`Base.cp\` when trying to copy large files

**URL:** <https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654>\
**Category:** General Usage\
**Created:** [September 25, 2025, 9:53am UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654 "2025-09-25T09:53:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![JosephPollacco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josephpollacco/32/51404_2.png) [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Post date:** [September 25, 2025, 9:53am UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654/1 "2025-09-25T09:53:20Z")

</div>

Dear Julia community,

I am having same problem that Base.cp fails for large file:  
I am using the latest version of Julia.

Thanks,  
Joseph

```Julia
IOError: sendfile: Unknown system error -146059294 (Unknown system error -146059294)

Stacktrace:
 [1] uv_error
   @ .\libuv.jl:106 [inlined]
 [2] sendfile(dst::Base.Filesystem.File, src::Base.Filesystem.File, src_offset::Int64, bytes::Int64)
   @ Base.Filesystem .\filesystem.jl:224
 [3] sendfile(src::String, dst::String)
   @ Base.Filesystem .\file.jl:1131
 [4] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
   @ Base.Filesystem .\file.jl:386
 [5] top-level scope
   @ d:\JOE\MAIN\MODELS\WFLOW\WflowDataJoe\WflowRaster.jl\src\jl_notebook_cell_df34fa98e69747e1a8f8a730347b8e2f_Y133sZmlsZQ==.jl:5

```

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 25, 2025, 12:36pm UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654/2 "2025-09-25T12:36:22Z")

</div>

Maybe you could work around it using `run`? e.g. something like

```julia-auto
function mycp(src::AbstractString, dst::AbstractString; force::Bool=false)
    cmd = Sys.iswindows() ? `cmd /c copy` : `cp`
    force_option = Sys.iswindows() ? (force ? `/y` : `/-y`) : (force ? `-f` : `-n`)
    cmd = `$cmd $force_option`
    run(`$cmd $src $dst`)
end

```

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [September 25, 2025, 1:22pm UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654/3 "2025-09-25T13:22:08Z")

</div>

This looks to be unrelated to the other issue; I’ve moved this to a new topic. Are you sure that you’re on the latest version of Julia? That error code is surprisingly unique; it doesn’t appear to have _ever_ been written down anywhere on GitHub or even on the web at large (until today), either as a signed or unsigned value.

Does the error persist in a fresh Julia session?

---

<div class="post-metadata">

**Author:** ![JosephPollacco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josephpollacco/32/51404_2.png) [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Post date:** [September 25, 2025, 1:29pm UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654/4 "2025-09-25T13:29:27Z")

</div>

Hi @stevengj ,  
You are ever so kind for solving my issue.  
Your solution works amazingly and solved the problem of moving very large NetCDF files.  
With Kindness,  
Joseph A.P. Pollacco

---

<div class="post-metadata">

**Author:** ![JosephPollacco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josephpollacco/32/51404_2.png) [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Post date:** [September 25, 2025, 1:34pm UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654/5 "2025-09-25T13:34:01Z")

</div>

Dear @mbauman ,

A great thanks for your reply. I am using _Version 1.11.7 (2025-09-08)_.  
I am trying to copy very large NetCDF files _80,108,221 KB_

The command I am using in Jupyter notebook:

```julia
      Base.Filesystem.cp(Path_Copy, Path_Paste, force=true)

```

Thanks for your kindness,  
Joseph

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [September 25, 2025, 2:16pm UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654/6 "2025-09-25T14:16:56Z")

</div>

Sounds similar to [IOError from cp with large file on Windows · Issue #30723 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/30723), although the exact error messages reported there vary a bit

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [September 25, 2025, 2:32pm UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654/7 "2025-09-25T14:32:13Z")

</div>

Yeah, it seems like the error number itself is getting corrupted in some way?

---

<div class="post-metadata">

**Author:** ![floswald](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/floswald/32/195_2.png) [@floswald](https://discourse.julialang.org/u/floswald)\
**Post date:** [October 24, 2025, 1:04pm UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654/8 "2025-10-24T13:04:57Z")

</div>

hi matt @mbauman I have been running into this error consistently as well.

```julia-auto
ERROR: IOError: sendfile: Unknown system error -184335295 (Unknown system error -184335295)
Stacktrace:
  [1] uv_error
    @ ./libuv.jl:106 [inlined]
  [2] sendfile(dst::Base.Filesystem.File, src::Base.Filesystem.File, src_offset::Int64, bytes::Int64)
    @ Base.Filesystem ./filesystem.jl:224
  [3] sendfile(src::String, dst::String)
    @ Base.Filesystem ./file.jl:1131
  [4] cptree(src::String, dst::String; force::Bool, follow_symlinks::Bool)
    @ Base.Filesystem ./file.jl:353
  [5] cptree
    @ ./file.jl:340 [inlined]
  [6] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
    @ Base.Filesystem ./file.jl:384

julia> versioninfo()
Julia Version 1.11.4
Commit 8561cc3d68d (2025-03-10 11:36 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

```

this is about a 4GB zip file. the `run` version of @stevengj works for me here.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [October 24, 2025, 1:09pm UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654/9 "2025-10-24T13:09:39Z")

</div>

If you’re able, it’d be great if you could try [use uv\_fs\_copyfile for cp by stevengj · Pull Request #59662 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/59662). You may be able to just install it from Juliaup directly: `juliaup add pr59662`.

---

<div class="post-metadata">

**Author:** ![floswald](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/floswald/32/195_2.png) [@floswald](https://discourse.julialang.org/u/floswald)\
**Post date:** [October 28, 2025, 8:43am UTC](https://discourse.julialang.org/t/error-146059294-in-base-cp-when-trying-to-copy-large-files/132654/10 "2025-10-28T08:43:33Z")

</div>

worked! left a comment on the PR
