#2 Can't find work directory.

Cerrada
aberta %!s(int64=2) %!d(string=hai) anos por stevet · 1 comentarios

Running from cron, it can't find the work directory.

https://www.includehelp.com/golang/how-to-get-the-directory-of-the-currently-running-file-in-golang.aspx

import (
    "os"
    "path/filepath"
)

pathExecutable, err := os.Executable()
if err != nil {
    panic(err)
}
// Getting the directory path/name
dirPathExecutable := filepath.Dir(pathExecutable)
os.Chdir(dirPathExecutable)

That should have the program in the expected directory.

Running from cron, it can't find the work directory. https://www.includehelp.com/golang/how-to-get-the-directory-of-the-currently-running-file-in-golang.aspx ```go import ( "os" "path/filepath" ) pathExecutable, err := os.Executable() if err != nil { panic(err) } // Getting the directory path/name dirPathExecutable := filepath.Dir(pathExecutable) os.Chdir(dirPathExecutable) ``` That should have the program in the expected directory.

On olympus, you'll see there's a roku.log in your home directory. (A symptom of this issue.) It won't find etherwake.

On olympus, you'll see there's a roku.log in your home directory. (A symptom of this issue.) It won't find etherwake.
Accede para unirte á conversa.
Sen fito
Sen asignado
1 participantes
Cargando...
Cancelar
Gardar
Aínda non existe contido.