// UseFileStore creates and returns a new storage container.  If a dir
// already exists, that directory will be used.  If the directory does
// not exist it will be created.
UseFileStore creates and returns a new storage container.  If a dir
already exists, that directory will be used.  If the directory does
not exist it will be created.
// UseFileStore creates and returns a new storage container . If a dir // already exists that directory will be used . If the directory does // not exist it will be created .
func UseFileStore(path string) (fs *FileStore, err error) {
	path = filepath.Clean(path)
	fs = &FileStore{
		Basepath: path,
		Name:     NameFromPath(path),
		Comment:  "Hello, World!",
	}
	if _, err := os.Stat(path); os.IsNotExist(err) {
		if err := os.MkdirAll(path, 0755); err != nil {
			return nil, fmt.Errorf("mkdir %s: %v", path, err)
		}
	}
	return fs, nil
}
func UseFileStore ( path string ) ( fs * FileStore , err error ) { path = filepath . Clean ( path ) fs = & FileStore { Basepath : path , Name : NameFromPath ( path ) , Comment : " " , } if _ , err := os . Stat ( path ) ; os . IsNotExist ( err ) { if err := os . MkdirAll ( path , 0755 ) ; err != nil { return nil , fmt . Errorf ( " " , path , err ) } } return fs , nil }
UseFileStore creates and returns a new storage container.
UseFileStore creates and returns a new storage container .
// TODO - Add a permission check, Determine if we are using // an existing directory or need to create a new one. // path did not exist, but it will now if we can help it