# macOS Catalina: Julia cannot access general files

**URL:** https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601
**Category:** General Usage
**Created:** [March 27, 2020, 2:50pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601 "2020-03-27T14:50:04Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![rsilva](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@rsilva](https://discourse.julialang.org/u/rsilva)
#### Post date: [March 27, 2020, 2:50pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/1 "2020-03-27T14:50:04Z")

</div>

I’ve spent some considerable amount of time looking for a solution to this, which I suppose is not very common at all. But I have the most basic Catalina 10.15.4 setup in a brand new machine, and Julia simply doesn’t have permission to read or modify any files. I’ve even granted ‘Full Disk Access’ to both JuliaPro 1.3 and Juila 1.4, and all I get are messages such as ‘IOError: mkdir: permission denied (EACCES)’ (by just starting a Julia 1.4 session) and ‘ERROR: IOError: open: operation not permitted (EPERM)’. I have MATLAB, RStudio and PyCharm in my machine, all work without any problems. I can also install Julia packages without any problem in my JuliaPro setup. Any suggestions? This is making my usage of Julia practically impossible for my projects that require file access.

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [March 27, 2020, 3:15pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/2 "2020-03-27T15:15:31Z")

</div>

What files is it trying to access?

---

<div class="post-metadata">

### Author: ![rsilva](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@rsilva](https://discourse.julialang.org/u/rsilva)
#### Post date: [March 27, 2020, 3:23pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/3 "2020-03-27T15:23:54Z")

</div>

Thank you for your quick reply. I can’t do any file manipulation (even reading) from my Documents folder (the same files I’ve tried with MATLAB etc.), and a fresh install of Julia 1.4 also reports errors right at the start up when trying to create a default directory:

**ERROR:** IOError: mkdir: permission denied (EACCES)

Stacktrace:

[1] **uv\_error** at **./libuv.jl:97** [inlined]

[2] **mkdir(** ::String; mode::UInt16 **)** at **./file.jl:177**

[3] **mkpath(** ::String; mode::UInt16 **)** at **./file.jl:227**

[4] **mkpath** at **./file.jl:222** [inlined]

[5] **setup\_interface(** ::REPL.LineEditREPL, ::Bool, ::Any **)** at **/Users/julia/buildbot/worker/package\_macos64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:869**

[6] **setup\_interface(** ::REPL.LineEditREPL; hascolor::Bool, extra\_repl\_keymap::Any **)** at **/Users/julia/buildbot/worker/package\_macos64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:779**

[7] **setup\_interface** at **/Users/julia/buildbot/worker/package\_macos64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:779** [inlined]

[8] **(::Pkg.var"#1#2")(** ::REPL.LineEditREPL **)** at **/Users/julia/buildbot/worker/package\_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Pkg.jl:519**

[9] **\_\_atreplinit(** ::REPL.LineEditREPL **)** at **./client.jl:339**

[10] **#invokelatest#1** at **./essentials.jl:712** [inlined]

[11] **invokelatest** at **./essentials.jl:711** [inlined]

[12] **\_atreplinit** at **./client.jl:346** [inlined]

[13] **(::Base.var"#764#766"{Bool,Bool,Bool,Bool})(** ::Module **)** at **./client.jl:382**

[14] **#invokelatest#1** at **./essentials.jl:712** [inlined]

[15] **invokelatest** at **./essentials.jl:711** [inlined]

[16] **run\_main\_repl(** ::Bool, ::Bool, ::Bool, ::Bool, ::Bool **)** at **./client.jl:367**

[17] **exec\_options(** ::Base.JLOptions **)** at **./client.jl:305**

[18] **\_start()** at **./client.jl:484**

Also, I’ve reinstalled JuliaPro, and now it can’t install package anymore…

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [March 27, 2020, 3:25pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/4 "2020-03-27T15:25:55Z")

</div>

It’s very hard to diagnose what’s happening based only on the error message. Need to see what you’re trying to do as well.

---

<div class="post-metadata">

### Author: ![rsilva](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@rsilva](https://discourse.julialang.org/u/rsilva)
#### Post date: [March 27, 2020, 3:40pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/5 "2020-03-27T15:40:42Z")

</div>

For example, file renaming:

julia\> mv(“/Users/myusername/Documents/oldname.txt”, “/Users/myusername/Documents/newname.txt”)  
ERROR: IOError: open: operation not permitted (EPERM)  
Stacktrace:  
[1] open(::String, ::UInt16, ::Int64) at /Applications/JuliaPro-1.3.1-1.app/Contents/Resources/julia/Contents/Resources/julia/lib/julia/sys.dylib:?  
[2] sendfile(::String, ::String) at /Applications/JuliaPro-1.3.1-1.app/Contents/Resources/julia/Contents/Resources/julia/lib/julia/sys.dylib:?  
[3] #cp#12(::Bool, ::Bool, ::typeof(cp), ::String, ::String) at /Applications/JuliaPro-1.3.1-1.app/Contents/Resources/julia/Contents/Resources/julia/lib/julia/sys.dylib:?  
[4] rename(::String, ::String) at /Applications/JuliaPro-1.3.1-1.app/Contents/Resources/julia/Contents/Resources/julia/lib/julia/sys.dylib:?  
[5] #mv#13 at ./file.jl:386 [inlined]  
[6] mv(::String, ::String) at ./file.jl:385  
[7] top-level scope at none:0

---

<div class="post-metadata">

### Author: ![rsilva](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@rsilva](https://discourse.julialang.org/u/rsilva)
#### Post date: [March 27, 2020, 3:42pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/6 "2020-03-27T15:42:12Z")

</div>

The equivalent command works in other programming languages (and on Finder, of course).

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [March 27, 2020, 6:23pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/7 "2020-03-27T18:23:14Z")

</div>

What does

```nohighlight
ls -ld /Users/myusername/Documents/

```

return in the shell? Also, what does `umask` in the shell print?

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [March 27, 2020, 6:35pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/8 "2020-03-27T18:35:57Z")

</div>

Catalina has been asking me to grant permissions every time an app (including eg iterm2 when I did something from the command line) tries to modify things in any of the “standard” folders (eg Desktop, Downloads, Music etc). I wonder if julia isn’t able to spawn those dialogues for some reason?

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [March 27, 2020, 7:17pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/9 "2020-03-27T19:17:38Z")

</div>

> [@kevbonham](#):
>
> I wonder if julia isn’t able to spawn those dialogues for some reason?

I just tried from Julia launched through iterm2, and it didn’t have a problem. Maybe try moving a file from the terminal first, before launching julia?

---

<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: [March 27, 2020, 7:48pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/10 "2020-03-27T19:48:24Z")

</div>

> [@kevbonham](#):
>
> I wonder if julia isn’t able to spawn those dialogues for some reason?

You apparently have to grant the `Julia` program access to the `Documents` folder (etc.) if you launch it by double-clicking: [https://www.howtogeek.com/443611/how-macos-catalinas-new-security-features-work/](https://www.howtogeek.com/443611/how-macos-catalinas-new-security-features-work/)

(If you launch things from the `Terminal` or similar, then it’s the permissions of the terminal software that matter instead.)

---

<div class="post-metadata">

### Author: ![rsilva](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@rsilva](https://discourse.julialang.org/u/rsilva)
#### Post date: [March 27, 2020, 11:30pm UTC](https://discourse.julialang.org/t/macos-catalina-julia-cannot-access-general-files/36601/11 "2020-03-27T23:30:14Z")

</div>

Thanks everybody for the answers so far. I discovered the main issue is related to my Documents folder in particular, for a reason I will explain. I can say that if I create another directory within `/Users/myusername`, I can manipulate it with my Julia installation. No chance if it’s within `/Users/myusername/Documents`. I’m really stumped by this, and it seems something very particular to my system configuration. Without wanting to make this too long and testing anyone’s patience, there is a particularity with this machine. When transferring files from an old Mac, a separate user was created to receive then. I then just copied the `Documents` folder from this other user into the Documents of my main user account. Ownership of `Documents` and its contents have been properly assigned. No other application is being affected afaik. Applications that are granted access to `Documents` only and nothing else have no issues, for instance. But somehow this is bothering Julia.

For completeness, I’ll provide some information to the points above. When I do `ls -ld /Users/myusername/Documents/`, I get

```julia
drwxr--r-x@ 31 officialusername staff 992 27 Mar 22:37 /Users/myusername/Documents/

```

Sorry for the confusion above: the directory of `myusername` is actually associated with a slightly different user ID (`officialusername`, long story, don’t ask). I don’t see this affecting anything, including backup software and anti-viruses. I can’t see how this would affect Julia, as concerning Catalina protections, I’ve already set it up for both JuliaPro and a stand-alone Julia 1.4 to have Full Disk Access. The same is true for Terminal, which has no problems with file manipulation. I recall RStudio prompted for `Documents` access the first time it was necessary, and MATLAB and PyCharm CE just asked for it at installation time, if I recall it correctly.

`umask` gives `u=rwx,g=rx,o=rx`.

(Concerning my comment above regarding my JuliaPro not updating packages anymore, I was actually able to fix it using `chown`, as actually helpfully suggested in some other page in this forum. So I have a JuliaPro installation that can update packages, but it’s unable to access files in `Documents`…)
