filelib

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2019 License: MIT Imports: 7 Imported by: 52

README

filelib

license

Go (golang) miscellaneous file and templating routines

Documentation

Overview

Copyright (C) Philip Schlump, 2013-2016. Version: 1.0.3 Tested on Mon Jun 20 18:01:48 MDT 2016

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(name string) bool

Exists reports whether the named file or directory exists.

func Fopen

func Fopen(fn string, mode string) (file *os.File, err error)

Fopen opens a file with a mode string - similar to C fopen

func Qt

func Qt(format string, data map[string]string) string

Qt is a string quick template. %{name%} gets replace with substitution from map if it is in map, else ""

func QtR

func QtR(format string, data map[string]interface{}) string

QtR is a string quick template. It uses the same format as Qt but you get to pass a map[string]interface{}

func RmExt

func RmExt(filename string) string

RmExt remove the extension from a file name and returns the name.

func SearchPathApp

func SearchPathApp(rawFileName string, appName string, searchPath string) (fullFileName string, ok bool)

SearchPathApp searches a set of paths for a particular file.

func SubstitueUserInFilePath

func SubstitueUserInFilePath(s string, mdata map[string]string) (rs string, has bool)

SubstitueUserInFilePath looks up the user and replaces '~' or '~name' whith the home direcotry

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL