You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After running for a long time, the user data file will become larger. How to delete this file after browser.stop using os.removel? Regardless of whether os. chmod ("path", 0777) is executed or not, it will still report "assessment is denied"; When using exec to delete a folder, it cannot be deleted, and cmd. run() does not report an error
use os.removeall:
err = os.chmod(userdatafile, 0777)
if err != nil {
log.Info("error infor:" + err.Error())
}
err = os.RemoveAll(userdatafile)
if err != nil {
log.Info("error infor:" + err.Error())
}
After running for a long time, the user data file will become larger. How to delete this file after browser.stop using os.removel? Regardless of whether os. chmod ("path", 0777) is executed or not, it will still report "assessment is denied"; When using exec to delete a folder, it cannot be deleted, and cmd. run() does not report an error
use os.removeall:
err = os.chmod(userdatafile, 0777)
if err != nil {
log.Info("error infor:" + err.Error())
}
err = os.RemoveAll(userdatafile)
if err != nil {
log.Info("error infor:" + err.Error())
}
use exec:
//cmd := exec.Command("cmd", "/C", "rmdir", "/s", "/q", userdatafile)
//err = cmd.Run()
//if err != nil {
// log.Info("error infor:" + err.Error())
//}
The text was updated successfully, but these errors were encountered: