Skip to content

Conversation

minrk
Copy link
Member

@minrk minrk commented Jan 26, 2016

instead of actually listing because listdir can be slow.

closes ipython/ipython#9165

@takluyver
Copy link
Member

This makes sense to me, but we're relying on a Unix-y idiom. Have we ensured that whatever it does on Windows produces a sane result? Do we need another check for directory accessibility on Windows?

access seems to always return True there
@minrk
Copy link
Member Author

minrk commented Jan 27, 2016

I tested that it didn't fail on Windows, at least, but after a little more digging I discovered that it just always returns True on Windows, no matter what. Fixed to use stat on Windows, which fails with PermissionDenied on unreadable dirs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use os.X_OK | os.R_OK? It's probably not important, but it's possible to have a directory that you can cd into and read files, but not list its contents.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Done.

takluyver added a commit that referenced this pull request Jan 27, 2016
use x-access for directory listing test in is_hidden
@takluyver takluyver merged commit 22a6e72 into jupyter:master Jan 27, 2016
@minrk minrk deleted the hidden-x-access branch March 25, 2016 08:22
@minrk minrk added this to the 4.2 milestone Mar 25, 2016
minrk added a commit that referenced this pull request Apr 8, 2016
instead of actually listing because listdir can be slow.

closes ipython/ipython#9165
yuvipanda pushed a commit to yuvipanda/notebook that referenced this pull request Jul 26, 2016
…s_hidden

instead of actually listing because listdir can be slow.

closes ipython/ipython#9165
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash if a subfolder of the current folder has more than 50'000 files

2 participants