"Fossies" - the Fresh Open Source Software Archive

Member "gdrive-2.1.1/auth/util.go" (28 May 2021, 288 Bytes) of package /linux/misc/gdrive-2.1.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Go source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 package auth
    2 
    3 import (
    4     "os"
    5     "path/filepath"
    6 )
    7 
    8 func mkdir(path string) error {
    9     dir := filepath.Dir(path)
   10     if fileExists(dir) {
   11         return nil
   12     }
   13     return os.Mkdir(dir, 0700)
   14 }
   15 
   16 func fileExists(path string) bool {
   17     _, err := os.Stat(path)
   18     if err == nil {
   19         return true
   20     }
   21     return false
   22 }