When I run os.mkdir()
, I can see the folder using ls
, but cannot view it with regular nautilus
(GNOME file manager, I'm running Ubuntu). In Edit->Preferences, I checked Show hidden and backup files
, which didn't help.
However, I discovered that I can view the Python-made folders using sudo nautilus
. I'm confused because this would mean Python creates folder that require root permission, but that is conflicted by the fact that I can view them using non-root ls
.
Is it possible to make Python let me see the folder using non-root Nautilus, and why is this happening?
Code:
import os
os.mkdir(os.getcwd() + '/myFolder')
ls -l
:
manually created folder, can view in Nautilus:
drwxrwxr-x 3 user user 4096 Mar 22 08:58 folder1
Can't view. Is it weird that it has the same file permission as the one above? But this one was created through Python.
drwxrwxr-x 3 user user 4096 Mar 22 08:40 folder2
Another one I can't view, created by root through Python
drwxr-xr-x 3 root root 4096 Mar 22 11:41 folder3
Parent folder:
drwxrwxrwx 21 user user 4096 Mar 23 17:36 parentFolder