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

For large sized files, 'FileCreatedEvent' is not waiting till the file has finished copying #586

Closed
akhilrajvc opened this issue Oct 24, 2019 · 1 comment

Comments

@akhilrajvc
Copy link

For large sized files, 'FileCreatedEvent' is triggered when the file first appears in the directory.
If we try to read that, we will get file corrupted exception as the file is not yet copied completely.
The workaround what we can do is checking the file size continuously in a loop and once the size is stable, we can continue with the process:
file_size = 0
while file_size != os.path.getsize(event.src_path):
file_size = os.path.getsize(event.src_path)
time.sleep(1)
I'm not feeling this solution is a perfect one.

@rrzaripov
Copy link
Contributor

@akhilrajvc same issue as in #567?

@BoboTiG BoboTiG closed this as completed Oct 24, 2019
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

3 participants