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

Peculiar observation in Windows. Output text file is updated only when the file is either 'tailed' or 'type <filename>' #105

Open
termsofservice212 opened this issue Aug 17, 2024 · 2 comments
Assignees

Comments

@termsofservice212
Copy link

Hello all,

Thought to raise this question because it's been bugging me for over a day. I am using rotating-file-stream on Win11 and it produces a text file. The size of this text file is never updated until I

  1. refresh the file in Windows Explorer by clicking on the file, or
  2. tail the file (eg Get-Content <filename> -Wait), or
  3. type the file (eg type <filename>)

I realise this is a Windows issue. Can anyone share why this is the case?

@iccicci
Copy link
Owner

iccicci commented Aug 17, 2024

I'm sorry, but I really don't know: I do not use windows.

I can leave the issue open, so if somebody from the community have some ideas...

@iccicci iccicci self-assigned this Aug 17, 2024
@Gredys
Copy link

Gredys commented Oct 7, 2024

@termsofservice212
Its just how windows works. Unless wiriting side call sync/flush its not gonna update file information in explorer.
But using sync/flush too much can make stress on the running system. And without using it - logs may be corrupted upon unexpected proccess/system exit. So it must be balanced in some way and not just flush/flush/flush all the time.

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