Can not stat a file in Linux from shell commands #398
richardstevenhack
started this conversation in
Debugging and testing
Replies: 1 comment
-
Hi @richardstevenhack !
That's probably the cause. Flatpak isolates Obsidian in a way that when executing shell commands, they have limited access to the filesystem, and so they can't access some files, nor execute some programs. More on Flatpak here, e.g. how to configure it to give Obsidian more permissions to certain directories. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is what I'm trying to do:
I'm sick to death of Obsidian Dataview using ctime on Linux for a file's creation date which is almost never correct depending on the file system.
I decided I needed to pull the date of a file directly from the stat command which will do the correct thing on any specific Linux.
I installed shell-commands and managed to figure out how to put the shell command in.
What I don't know how to do is set the "working directory" so that the shell command executes.
This is the shell command I want to run as a test - it asks for the "birth date" of the test file:
stat -c %w "/Data2/Planning/Obsidian Vault/Untitled.md"
This command runs perfectly fine from the command line:rhack@localhost:/Data2/Work> stat -c %w "/Data2/Planning/Obsidian Vault/Untitled.md" 2024-02-25 16:45:41.981826021 -0800
This is what the plugin tells me:
stat: cannot statx '/Data2/Planning/Obsidian Vault/Untitled.md': No such file or directory
The file does exist, the path is right, here is the Dolphin report straight from Dolphin's "Copy Location" command:
/Data2/Planning/Obsidian Vault/Untitled.md
Why is the plugin saying this file doesn't exist?
It would seem to have something to do with the "working directory". When I execute the command on the command line in the konsole in "Data2/Work", it works fine. When I put in "Data2/Work" in the "Working Directory" section of the plugin, and run the command it says "Working Directory does not exist: /Data2/Work"
I'm running on openSUSE Tumbleweed, latest snapshot, as a normal user. NOTE: This Obsidian is a Flatpak installation.
Beta Was this translation helpful? Give feedback.
All reactions