Can't access .local fold via a program

Hi,

I wanted to access this folder via a program however it can't see it, I can see it clearly in file manager but not the program I am using, is this invisible/hidden and if so do I need to unhide it to make it accessible? Thanks in advance.

/home/home/.local/share

First of all /home/home looks strange. Probably you mean /home/your-username.

Then about the ~/.local folder.

You can check its current state - existence and permissions by

ls -ald ~/.local/share

and then do the following:

  • if it does not exist - create it by

    mkdir -p ~/.local/share
    
  • if it has root user as owner - change permissions to yours by

    sudo chown -R $USER:$USER ~/.local/share
    

Also please note that such hidden folders are viewable by Caja if you press Ctrl+H or select ViewShow Hidden Files.

Hi,

Thanks for your response, home is my username.

home@Home:~$ ls -ald ~/.local/share
drwxr-xr-x 27 home home 4096 Mar  5 15:09 /home/home/.local/share
home@Home:~$ 

So with the above command I couldn't see anything wrong, however when I tried using the program as its root mode I still couldn't see .local.

You do not need root mode to open a folder inside your home folder.

Simply open Caja (or other Gtk-based application with GtkFileChooser dialog), press Ctrl+H and then navigate to ~/.local/share here. Or use terminal command as normal user - caja ~/.local/share.

Well whatever the problem is, root or not, I still was unable to access the folder via the program. It just doesnt display it.

Try this in python3 (command line)

 import os
 arr = os.listdir("/home/home/.local/share")
 print (arr)

I get

['icons', 'applications', 'gstreamer-1.0', 'rhythmbox', 'gvfs-metadata', 'recently-used.xbel', 'desktop-directories', 'Trash', 'flatpak', 'evolution', 'inxi', 'keyrings', 'mime', 'webkitgtk']

I don't know about python 3 but this is what I get:

home@Home:~$ import os
 arr = os.listdir("/home/home/.local/share")
 print (arr)
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/421.
bash: syntax error near unexpected token `('
bash: syntax error near unexpected token `arr'
home@Home:~$

you need to start python3 and then issue the commands. In my case, username is user

user@lake:~$ python3
Python 3.8.10 (default, Nov 26 2021, 20:14:08) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> arr = os.listdir("/home/user/.local/share")
>>> print(arr)
['icons', 'applications', 'gstreamer-1.0', 'rhythmbox', 'gvfs-metadata', 'recently-used.xbel', 'desktop-directories', 'Trash', 'flatpak', 'evolution', 'inxi', 'keyrings', 'mime', 'webkitgtk']
>>> quit()
user@lake:~$
1 Like

home@Home:~$ python3
Python 3.9.7 (default, Sep 10 2021, 14:59:43)
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import os
File "", line 1
import os
IndentationError: unexpected indent
arr = os.listdir(/home/home/.local/share)
File "", line 1
arr = os.listdir(/home/home/.local/share)
IndentationError: unexpected indent
print (arr)
File "", line 1
print (arr)
IndentationError: unexpected indent

Just wondering, are you showing me exactly what has to be copied or are you using quote marks and brackets as a means to infer I may need to edit it somehow?
Thanks for your help.

In open office I cant see the .local folder listed either? Is .local a folder name or some special link?

prompt is bash
type python3,
prompt becomes >>>
type, import os
prompt is again >>>
type, arr = os.listdir("/home/home/.local/share")
prompt is again >>>
type, print (arr)
see the output, prompt is >>>
you type, quit()
prompt is bash now.

Wow thank you pavlos_kairis, the output shows all files and folders including .local, so what does this tell us and why is it seeing the .local but not the programs like the office? Does it have anything to do with the user who installed it (me as opposed to root?) mind you I did not have to do any root user command to run the python commands?

I started LibreOffice Writer, File > Open point to Home, press ctrl+h, you will see the hidden files/dirs.
press ctrl+h again, they are gone. In general, ctrl+h is a toggle switch to show/hide hidden items.

The term Program refers to (bash, C, C++, perl, python, rust, etc.) but the term Application refers to LibreOffice Base, Writer, Calc, Impress, Draw, etc. Firefox is an Application, not a program.

OK well this has solved the problem doing crtl+h thank you pavlos_kairis you have been most helpful. I see Norbert advised this though I assumed this would only apply within the files application.