package part
import (
- "sync"
"fmt"
"time"
"runtime"
"syscall"
"errors"
"os"
- "io/ioutil"
-
- "github.com/qydysky/part/linuxwin"
+ "io/ioutil"
)
-type checkfile struct {sync.Mutex}
+type checkfile struct {}
func Checkfile() *checkfile{
return &checkfile{}
}
func (this *checkfile) IsExist(f string) bool {
- this.Lock()
- defer this.Unlock()
-
- return Ppart.PIsExist(f)
+ _, err := os.Stat(f)
+ return err == nil || os.IsExist(err)
}
func (this *checkfile) IsOpen(f string) bool {
}
func (this *checkfile) Checkfile(src string)(string,error){
- this.Lock()
- defer this.Unlock()
str,err:=this.GetAllFile(src)
}
func (this *checkfile) GetAllFile(pathname string) (string,error) {
- this.Lock()
- defer this.Unlock()
var returnVal string = ""
}
func (this *checkfile) GetFileSize(path string) int64 {
- this.Lock()
- defer this.Unlock()
if !this.IsExist(path) {
return 0
}
func (this *checkfile) GetFileModTime(path string) (error,int64) {
- this.Lock()
- defer this.Unlock()
f, err := os.Open(path)
if err != nil {
PRun(true,"kwriteconfig5","--file","kioslaverc","--group","'Proxy Settings'","--key","Proxy Config Script","\""+pacUrl+"\"");
}
}
-
-func PIsExist(f string) bool{
- _, err := os.Stat(f)
- return err == nil || os.IsExist(err)
-}
\ No newline at end of file
dir, _ := os.Executable()
exPath := filepath.Dir(dir)
return exPath
-}
-func PIsExist(f string) bool{
- _, err := os.Stat(f)
- return err == nil || os.IsExist(err)
}
\ No newline at end of file