Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Could not see any files in the explorer... #3607

Unanswered
miketaochina asked this question in Q&A
Discussion options

Dear:

I have set up everything for code-server, and opened it in safari, but it could not show any files in the explorer.

I checked the code-server.log, it showed:

[node.js fs] readdir with filetypes failed with error: [Error: EPERM: operation not permitted, scandir '/Users/name/Desktop/mitStudy/Courses/Network Security/python_courses/Personal'] {
 errno: -1,
 code: 'EPERM',
 syscall: 'scandir',
 path: '/Users/name/Desktop/mit/Study/Courses/Network Security/python_courses/Personal'
}

anyone can help please? thanks.

Best regards
Mike

You must be logged in to vote

Replies: 1 comment 17 replies

Comment options

Hmm...it looks like it wasn't able to read your directories due to permissions? Where is code-server running and how did you install it?

You must be logged in to vote
17 replies
Comment options

You don't need to escape the space, the quote marks in the ls command handle it for you!

This is strange though. It looks like you have permissions to the directory. Are you able to create files from the terminal there? For example:

cd "/Users/mike/Desktop/MT/Study/Courses/Network Security/python_courses/Personal"
touch test

If that works, try:

code-server "/Users/mike/Desktop/MT/Study/Courses/Network Security/python_courses/Personal"
Comment options

Dear:

Are you able to create files from the terminal there?

I have tried: cd "/Users/mike/Desktop/MT/Study/Courses/Network Security/python_courses/Personal" touch test and it showed me nothing, but when I go to Mac finder, I can see that the files are created.
截屏2021年06月22日 18 58 44

Then I have tried: code-server "/Users/mike/Desktop/MT/Study/Courses/Network Security/python_courses/Personal", it showed me:

(base) YEMBP:Personal mike$ code-server "/Users/mike/Desktop/MT/Study/Courses/Network Security/python_courses/Personal"
[2021年06月21日T19:20:43.657Z] info code-server 3.10.2 387b12ef4ca404ffd39d84834e1f0776e9e3c005
[2021年06月21日T19:20:43.658Z] info Using user-data-dir ~/.local/share/code-server
[2021年06月21日T19:20:43.669Z] info Using config file ~/.config/code-server/config.yaml
[2021年06月21日T19:20:43.669Z] info HTTP server listening on http://192.168.1.175:8080 
[2021年06月21日T19:20:43.669Z] info - Authentication is enabled
[2021年06月21日T19:20:43.669Z] info - Using password from ~/.config/code-server/config.yaml
[2021年06月21日T19:20:43.669Z] info - Not serving HTTPS 
[IPC Library: Pty Host] INFO Persistent process "2": Replaying 219 chars and 1 size events

截屏2021年06月22日 18 50 08

And suddenly the code-server works, I can see and edit the files and folders from `code-server web`. And one more question here, how I can run the code I write from `code-server web`? For example: the hello.py in the path: `"/Users/mike/Desktop/MT/Study/Courses/Network Security/python_courses/1DV501/1DV501/yt222ar_assign1/hello.py"`

Many thanks,
Best regards,

Mike

Comment options

And one more question here, how I can run the code I write from code-server web?

You should be able to open that folder in code-server, open the Integrated Terminal and then run python hello.py

Comment options

Dear:

open that folder in code-server

I have done this and tried both python hello.py and python3 hello.py, but none of them worked, they showed: can't open file 'hello.py': [Errno 2] No such file or directory.

截屏2021年06月22日 22 33 01

And unfortunately when I writing the message, code-server web stoped working again(could not see anything again), so I tried above thing in vscode locally.
So I am think to escape the space from Network Security, make it into Network_Security. Should I change it in macOS files system or change it in VScode?
Many thanks,
Best regards,

Mike

Comment options

have done this and tried both

From the screenshot it looks like you're Terminal is in a different folder than hello.py is in? Which is why that wouldn't work. You need to cd into that folder. Looks like from the file explorer you're in yt222ar_assign1 but the terminal is in Courses? Hard to tell.

Inside terminal, run pwd to see the working directory. If it shows yt222ar_assign1 then you are in the right place and can run python hello.py. If it isn't, then you need to cd into that directory and then you can run python hello.py.

Should I change it in macOS files system or change it in VScode

Either works! I would use whatever you're more comfortable with!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /