func isPathWriteable(p gopath.GoPath) bool { if p.IsDirectory() { return isDirWriteable(p) } return isFileWriteable(p) }
func (m *mimeDetector) mimeTypeForPath(p gopath.GoPath) string { p = p.EvalSymlinks() if p.IsDirectory() || p.HasErr() { return store.FallbackMimeType } var ext = p.Ext() if mimeType := mime.TypeByExtension(ext); mimeType != "" { return mimeType } var first512Bytes = m.first512BytesForPath(p) m.errAndClear() // clear error flag, as DetectContentType always returns something return http.DetectContentType(first512Bytes) }
func (a *accessControl) canWriteDirectory(p gopath.GoPath) bool { if p.HasErr() || !p.IsDirectory() { return false } return a.hasWorldWritePermission(p.FileMode()) }