mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-12-04 05:43:27 +01:00
CompressDir deleted each file as it was added and wrote the zip last, so a failure lost the output, and it packed and deleted every file in -d. The writer now packs only the files it wrote, renames the zip into place, and only then removes them.
16 lines
267 B
Go
16 lines
267 B
Go
package fileutil
|
|
|
|
import "os"
|
|
|
|
// FileExists checks if the file exists in the provided path.
|
|
func FileExists(filename string) bool {
|
|
info, err := os.Stat(filename)
|
|
if os.IsNotExist(err) {
|
|
return false
|
|
}
|
|
if err != nil {
|
|
return false
|
|
}
|
|
return !info.IsDir()
|
|
}
|