// longFileName converts a non-UNC path to a \?\\ style long path.
355242
func longFileName(path string) string {
	const MAGIC = `\\?\`
	if !strings.HasPrefix(path, MAGIC) {
		path = MAGIC + path
	}
	return path
}
959673
func (t *File) Name() string {
	if t.fh == nil {
		return ""
	}
	return t.fh.Name()
}
425781
func (g *GistFile) GetFilename() string {
	if g == nil || g.Filename == nil {
		return ""
	}
	return *g.Filename
}
1217269
func (l *LanguageOpts) MangleFileName(name string) string {
	if l.fileNameFunc != nil {
		return l.fileNameFunc(name)
	}
	return swag.ToFileName(name)
}
758211
func (v *FileChooser) SelectFilename(filename string) bool {
	ptr := C.CString(filename)
	defer cfree(ptr)
	return gobool(C.gtk_file_chooser_select_filename(v.GFileChooser, ptr))
}
1231729
func (rd *RAMDirectory) FileLength(name string) (length int64, err error) {
	rd.EnsureOpen()
	rd.fileMapLock.RLock()
	defer rd.fileMapLock.RUnlock()
	if file, ok := rd.fileMap[name]; ok {
		return file.Length(), nil
	}
	return 0, os.ErrNotExist
}
1294782
func (c *SQLiteConn) GetFilename(schemaName string) string {
	if schemaName == "" {
		schemaName = "main"
	}
	return C.GoString(C.sqlite3_db_filename(c.db, C.CString(schemaName)))
}
1029216
func SanitizeFileName(fileName string) string {
	ext := filepath.Ext(fileName)
	cleanExt := sanitize.BaseName(ext)
	if cleanExt == "" {
		cleanExt = ".unknown"
	}
	return strings.Replace(fmt.Sprintf(
		"%s.%s",
		sanitize.BaseName(fileName[:len(fileName)-len(ext)]),
		cleanExt[1:],
	), "-", "_", -1)
}
536454
func (h *AttachmentHeader) SetFilename(filename string) {
	dispParams := map[string]string{"filename": filename}
	h.SetContentDisposition("attachment", dispParams)
}
230710
func StatsFilename(tsmPath string) string {
	if strings.HasSuffix(tsmPath, "."+TmpTSMFileExtension) {
		tsmPath = strings.TrimSuffix(tsmPath, "."+TmpTSMFileExtension)
	}
	if strings.HasSuffix(tsmPath, "."+TSMFileExtension) {
		tsmPath = strings.TrimSuffix(tsmPath, "."+TSMFileExtension)
	}
	return tsmPath + "." + TSSFileExtension
}
290148
func LogFilename(c Config) string {
	return filepath.Join(c.LogDir(), c.Tag().String()+".log")
}
1074921
func canonicalTarName(name string, isDir bool) string {
	name = CanonicalTarNameForPath(name)

	// suffix with '/' for directories
	if isDir && !strings.HasSuffix(name, "/") {
		name += "/"
	}
	return name
}
1316544
func (loc *Location) Filename() string {
	nmr := loc.Namer()
	if loc.filename == "" && nmr == nil {
		log.Fatal("[F] No filename or namer set")
	}

	if loc.filename == "" {
		loc.filename = nmr.String()

		if !loc.opts.compress {
			newName := reGzip.ReplaceAllString(loc.filename, "")
			loc.filename = newName
		}
	}
	return loc.filename
}
212186
func (b Base) GetFileName() string {
	if b.FileName != "" {
		return b.FileName
	}
	if b.Url != "" {
		return filepath.Base(b.Url)
	}
	return ""
}
115066
func (p *FileProvider) filename() (string, error) {
	if p.Filename == "" {
		if p.Filename = os.Getenv(FileCredentialsEnvVarFile); p.Filename != "" {
			return p.Filename, nil
		}

		homeDir := os.Getenv("HOME") // *nix
		if homeDir == "" {           // Windows
			homeDir = os.Getenv("USERPROFILE")
		}
		if homeDir == "" {
			return "", ErrFileCredentialsHomeNotFound
		}

		p.Filename = filepath.Join(homeDir, ".spotinst", "credentials")
	}

	return p.Filename, nil
}
806945
func (c *CompileContext) SetFilename(f string) {
	c.filename = f
	c.ctx.filename = C.CString(c.filename)
}
1335929
func (s *AttachmentDetails) SetFileName(v string) *AttachmentDetails {
	s.FileName = &v
	return s
}