Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The delete directory process exits #81

Open
zdwork opened this issue Sep 17, 2019 · 10 comments
Open

The delete directory process exits #81

zdwork opened this issue Sep 17, 2019 · 10 comments

Comments

@zdwork
Copy link

zdwork commented Sep 17, 2019

Don't want him to back out and help

@Akumzy
Copy link

Akumzy commented Sep 17, 2019

@zdwork sorry?

@zdwork
Copy link
Author

zdwork commented Sep 17, 2019

Is there any good way to solve it? I did it with a gorouting, as long as we don't let the main process exit

@Akumzy
Copy link

Akumzy commented Sep 17, 2019

Sorry I still don't understand what you're trying to say.

@zdwork
Copy link
Author

zdwork commented Sep 17, 2019

Don't let main exit.goroutine exec tail

@zdwork
Copy link
Author

zdwork commented Sep 17, 2019

How do you delete a file without letting it exit

@Akumzy
Copy link

Akumzy commented Sep 17, 2019

You can remove the directory from watcher before deleting it.

@zdwork
Copy link
Author

zdwork commented Sep 17, 2019

Excuse me, how do I do that

@Akumzy
Copy link

Akumzy commented Sep 17, 2019

w.RemoveRecursive(path)
//or
w.Remove(path)

@zdwork
Copy link
Author

zdwork commented Sep 17, 2019

Sorry, what I just said is wrong, we all delete it first

@zdwork
Copy link
Author

zdwork commented Sep 17, 2019

if name == err.(*os.PathError).Path {
//w.Error <- ErrWatchedFileDeleted
w.RemoveRecursive(name)
}

howdy Is that ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants