Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for mkdirAllIgnorePerm (0.18 sec)

  1. cmd/config-dir.go

    )
    
    // Get - returns current directory.
    func (dir *ConfigDir) Get() string {
    	return dir.path
    }
    
    // Attempts to create all directories, ignores any permission denied errors.
    func mkdirAllIgnorePerm(path string) error {
    	err := os.MkdirAll(path, 0o700)
    	if err != nil {
    		// It is possible in kubernetes like deployments this directory
    		// is already mounted and is not writable, ignore any write errors.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 3K bytes
    - Viewed (0)
  2. cmd/common-main.go

    		return nil, fmt.Errorf("provided option cannot be empty")
    	}
    
    	// Disallow relative paths, figure out absolute paths.
    	dirAbs, err := filepath.Abs(dir)
    	if err != nil {
    		return nil, err
    	}
    	err = mkdirAllIgnorePerm(dirAbs)
    	if err != nil {
    		return nil, fmt.Errorf("unable to create the directory `%s`: %w", dirAbs, err)
    	}
    
    	return &ConfigDir{path: dirAbs}, nil
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Apr 24 04:08:47 GMT 2024
    - 35.5K bytes
    - Viewed (2)
Back to top