// CurrentFileName returns the current file name that
// the RotateLogs object is writing to
487366
func (rl *RotateLogs) CurrentFileName() string {
	rl.mutex.RLock()
	defer rl.mutex.RUnlock()
	return rl.curFn
}
967925
func (s *OutputFileUriValue) SetFileName(v string) *OutputFileUriValue {
	s.FileName = &v
	return s
}
856480
func (l *FileLogger) rotate() error {
	oldFile := l.out
	file, err := doRotate(l.out.Name(), l.maxRotate)
	if err != nil {
		return fmt.Errorf("Error rotating logs: %s", err)
	}
	l.curLines = 0
	l.out = file
	oldFile.Close()
	return nil
}
81737
func uriPathToFilename(uriPath string) string {
	if runtime.GOOS != "windows" {
		return uriPath
	}

	// Convert slashes and remove first `/` left over from the URI path since
	// absolute path on Windows won't start with `\`.
	filename := strings.TrimPrefix(uriPath, `/`)
	return filepath.FromSlash(filename)
}
159861
func (c *CommitFile) GetFilename() string {
	if c == nil || c.Filename == nil {
		return ""
	}
	return *c.Filename
}
964243
func filename(input string) string {

	// Convert to lowercase
	output := strings.ToLower(input)

	// Replace :: with -
	output = strings.Replace(output, "::", "-", -1)

	// Replace . with _
	output = strings.Replace(output, ".", "_", -1)

	// Suffix with .go
	output += ".go"

	return output

}
604301
func (c *CommitFile) GetPreviousFilename() string {
	if c == nil || c.PreviousFilename == nil {
		return ""
	}
	return *c.PreviousFilename
}
417892
func (s *fileStore) CurrentPath() string {
	return filepath.Join(s.certDirectory, s.filename(currentPair))
}
940207
func (c *fileCache) filename(key string) string {
	return path.Join(c.dirname, c.nameFn(key))
}
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))
}
625772
func (c *Cloud) CurrentNodeName(hostname string) (types.NodeName, error) {
	return c.selfAWSInstance.nodeName, nil
}
354276
func (m *metadata) CurrentNodeName(ctx context.Context, hostname string) (types.NodeName, error) {
	return types.NodeName(hostname), nil
}
329885
func (d *Datastore) KeyFilename(key ds.Key) string {
	return filepath.Join(d.path, key.String(), ObjectKeySuffix)
}
588267
func NewFileName(X *xgbutil.XUtil, fileName string) (*Image, error) {
	srcReader, err := os.Open(fileName)
	if err != nil {
		return nil, err
	}
	defer srcReader.Close()

	img, _, err := image.Decode(srcReader)
	if err != nil {
		return nil, err
	}
	return NewConvert(X, img), nil
}
466362
func (g *Generator) WriteToFilename(filename string) error {
	if g.packageName == "" {
		g.packageName = filepath.Base(filepath.Dir(filename))
	}

	buf := bytes.NewBuffer([]byte{})

	if _, err := g.WriteTo(buf); err != nil {
		return fmt.Errorf("failed to write generated source to file: %v", err)
	}

	formatted, err := imports.Process(filename, buf.Bytes(), nil)
	if err != nil {
		return fmt.Errorf("failed to fix imports: %v\n%s", err, string(buf.Bytes()))
	}

	f, err := os.Create(filename)
	if err != nil {
		return fmt.Errorf("failed to create file: %v", err)
	}

	if _, err := f.Write(formatted); err != nil {
		return fmt.Errorf("failed to write formatted source: %v", err)
	}

	if err := f.Close(); err != nil {
		return fmt.Errorf("failed to close file: %v", err)
	}

	return nil
}
1112277
func GetFileCredentialsName(name string) (usr string, grp string, err error) {
	return "", "", fmt.Errorf("Not supported on this platform")
}
839612
func checkFilename(name string) error {
	cleanedName := path.Clean(name)
	if cleanedName != name {
		// The filename on the wire should be in canonical format. If
		// Clean() managed to clean it up, there was something wrong with
		// it.
		return errUncleanFilename
	}

	switch name {
	case "", ".", "..":
		// These names are always invalid.
		return errInvalidFilename
	}
	if strings.HasPrefix(name, "/") {
		// Names are folder relative, not absolute.
		return errInvalidFilename
	}
	if strings.HasPrefix(name, "../") {
		// Starting with a dotdot is not allowed. Any other dotdots would
		// have been handled by the Clean() call at the top.
		return errInvalidFilename
	}
	return nil
}