2016-01-31 03:32:08 +00:00
|
|
|
package tsm1
|
|
|
|
|
2016-04-27 16:24:42 +00:00
|
|
|
import "os"
|
|
|
|
|
2016-01-31 03:32:08 +00:00
|
|
|
func syncDir(dirName string) error {
|
|
|
|
return nil
|
|
|
|
}
|
2016-04-27 16:24:42 +00:00
|
|
|
|
|
|
|
// renameFile will rename the source to target using os function. If target exists it will be removed before renaming.
|
|
|
|
func renameFile(oldpath, newpath string) error {
|
|
|
|
if _, err := os.Stat(newpath); err == nil {
|
|
|
|
if err = os.Remove(newpath); nil != err {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return os.Rename(oldpath, newpath)
|
|
|
|
}
|