* initial completion of the sharing function

* Adjusting multi-partition disk mounts

* Add file sharing function

* update usb auto mount shell

* update samba config

* add umount disk function

* update change log

* update usb auto mount \

* update usb auto mount

* Update periodical.go
This commit is contained in:
link
2022-08-15 11:37:21 +08:00
committed by GitHub
parent 848ee63386
commit cee34ec1c2
46 changed files with 2167 additions and 592 deletions

View File

@@ -547,3 +547,20 @@ func MoveFile(sourcePath, destPath string) error {
}
return nil
}
func ReadLine(lineNumber int, path string) string {
file, err := os.Open(path)
if err != nil {
return ""
}
fileScanner := bufio.NewScanner(file)
lineCount := 1
for fileScanner.Scan() {
if lineCount == lineNumber {
return fileScanner.Text()
}
lineCount++
}
defer file.Close()
return ""
}