cleaning up manager, tying it to add files
This commit is contained in:
@@ -4,10 +4,8 @@ import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
logger "github.com/apsdehal/go-logger"
|
||||
@@ -66,19 +64,19 @@ func ExpandToIntArray(length int64, arry []byte, intArray *[]int64) error {
|
||||
|
||||
// VerifySrcFile checks to see that the file is a regular file
|
||||
// that the OS has meta information about and that can be read by
|
||||
// the os.
|
||||
func VerifySrcFile(src string) (string, error) {
|
||||
_, fileName := filepath.Split(src) //dirPath
|
||||
sourceFileStat, err := os.Stat(src)
|
||||
if err != nil {
|
||||
return fileName, errors.New("error on os.Stat " + err.Error())
|
||||
}
|
||||
// the os. Currently done in client or server before handing off to engine since some checks don't involve database/manager
|
||||
// func VerifySrcFile(src string) (string, error) {
|
||||
// _, fileName := filepath.Split(src) //dirPath
|
||||
// sourceFileStat, err := os.Stat(src)
|
||||
// if err != nil {
|
||||
// return fileName, errors.New("error on os.Stat " + err.Error())
|
||||
// }
|
||||
|
||||
if !sourceFileStat.Mode().IsRegular() {
|
||||
return fileName, errors.New("%s is not a regular file" + src)
|
||||
}
|
||||
return fileName, nil
|
||||
}
|
||||
// if !sourceFileStat.Mode().IsRegular() {
|
||||
// return fileName, errors.New("%s is not a regular file" + src)
|
||||
// }
|
||||
// return fileName, nil
|
||||
// }
|
||||
|
||||
//InitiateDirectory checks all of the directories to make sure they exist
|
||||
func InitiateDirectory(directory string) {
|
||||
|
Reference in New Issue
Block a user