File: nosymlink.go

package info (click to toggle)
golang-github-hlandau-goutils 0.0~git20160722.0.0cdb66a-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 160 kB
  • sloc: makefile: 2
file content (13 lines) | stat: -rw-r--r-- 337 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
package os

import "os"

// Opens a file but does not follow symlinks.
func OpenFileNoSymlinks(path string, flags int, mode os.FileMode) (*os.File, error) {
	return openFileNoSymlinks(path, flags, mode)
}

// See OpenFileNoSymlinks.
func OpenNoSymlinks(path string) (*os.File, error) {
	return OpenFileNoSymlinks(path, os.O_RDONLY, 0)
}