Background
CLion's remote project feature currently doesn't support FreeBSD as a remote host OS, but I want to do some hacking and see if it works. By reading the log file, I think I have spotted (one of) the issue.
2019-04-10 00:13:55,850 [2221079] DEBUG - #com.jetbrains.ssh.nio - UnixSshFS:: SshCommandRunner.execute: test -e "/tmp"
2019-04-10 00:13:55,851 [2221080] DEBUG - ellij.ssh.SshConnectionService - Executing SSH command: env "LC_ALL"="C" "JETBRAINS_REMOTE_RUN"="1" test -e "/tmp" within SSH session @3aa57c95 to <user>@<host>::22
2019-04-10 00:13:55,963 [2221192] DEBUG - #com.jetbrains.ssh.nio - UnixSshFS:: SshCommandRunner.execute: stat --printf "%W%i%F%F%F%F%X%Y%s" "/"
2019-04-10 00:13:55,963 [2221192] DEBUG - ellij.ssh.SshConnectionService - Executing SSH command: env "LC_ALL"="C" "JETBRAINS_REMOTE_RUN"="1" stat --printf "%W%i%F%F%F%F%X%Y%s" "/" within SSH session @3aa57c95 to <user>@<host>:22
2019-04-10 00:13:56,071 [2221300] INFO - #com.jetbrains.ssh.nio -
Exit code 1
Basically, stat(1)
behaves differently on Linux and on FreeBSD, so the following command fails on FreeBSD-12.0, halting the entire setting up procedure:
$ stat --printf "%W%i%F%F%F%F%X%Y%s" "/"
stat: illegal option -- -
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle ...]
I thought that the gstat
utility in coreutils
is the GNU version of stat
, but I turned out to be wrong; they are two different commands. I have also tried translating it myself, but I ended up with something weird:
$ stat -f "%B%i%T%T%T%T%a%Y%z" "/"
15006030802////15041781781024
Question
Is it possible to rewrite the command stat --printf "%W%i%F%F%F%F%X%Y%s" "/"
for FreeBSD, so that it works the same way as its counterpart does on GNU/Linux?
stat
you want and build it on the BSD system?--printf
arg to-f
and call systemstat
with that.