-
Notifications
You must be signed in to change notification settings - Fork 375
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
Windows: Handling git better, not keep files open.. #109
Comments
Thanks for the report, the only reason why glogg keeps the file open is performance. It is WAY slower to close and reopen the file every time glogg needs to redraw the screen. Interestingly this is what happened before 1.0.3 (see 90684c5 where I did the change and mentioned some perf measurements). |
This is a real issue for me as well. My logging system tries to rename or delete the daily log file at the end of the day but if someone is still watching the log file with the latest version of glogg, the file operation fails because the file is kept open by glogg. |
I'd take slower performance over messing up log rotation because I kept a file open. Whatever the performance impact is, I doubt it will make it slower than the only other real competitor I've used: BareTail. Glogg has incredible search performance compared to BareTail which is the main reason why I'm dealing with the files being locked instead of using BareTail like everyone else at my workplace. I hope you consider adding that option to reopen the file on redraw instead of holding it open. |
Windows allows to open file with delete access. one needs to specify FILE_SHARE_DELETE for CreateFile api call. |
As far as I know that simply means that others who open the file handle
with request for delete access won't be denied. The actual delete operation
should still fail as long as any other handle to the file remains open.
On Feb 6, 2018 1:52 AM, "Ilya Shvetsov" <notifications@github.com> wrote:
Windows allows to open file with delete access. one needs to specify
FILE_SHARE_DELETE for CreateFile api call.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#109 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAh9QOAW1TvhFQo-Av9Dn18Qd2vQ9hZXks5tR_awgaJpZM4H0p3K>
.
|
well, ok. i do not have time to check it my self, although i do not see any sense to have right for operation which you can not complete anyway. lets say, flag in settings will be einough. |
I can confirm from personal dev experience that FILE_SHARE_DELETE allows a file to be deleted (actually "deleted") while handles are open. The problem is, this won't help, because while the OS will honor the delete request once all handles have been closed, while the file is still being held, it's name is still there and not ready for reuse. |
Hello @nickbnf, any news on the "don't keep the file open" option? I've got a similar issue with rotating Log4Net logs: if I keep them open in glogg, the rotation doesn't occur as the files are locked. I'll temporarily solve this forcing a glogg process termination on my client machine before the rotation time, but having an option would be great. |
Please @nickbnf, add this as an option. |
As @wiz0u pointed out, version 1.0.2 has this feature (with some performance degradation though). I have switched to it given the cost benefit for my use case. Quick link is here: http://glogg.bonnefon.org/files/glogg-v1.0.2-1-setup.exe |
I use Glogg as a file viewer on windows, due to its extremely good handling of very large files.
From a Java project, we create some huge "report files" which are checked into git.
However, I do get some problems with git, as glogg evidently (quite obviously, given its "log viewer" main feature) keeps the files open. This works for the Java-task that writes to the file, as it evidently just truncs the file before writing a new report - nicely being caught by Glogg which reloads it instantly.
However, when handling the files with git (e.g. checkout, pull/rebase, whatever), it fails miserably, as git evidently unlinks (deletes) the file before putting in new content. This is not possible when glogg is active - and since I view these files all the time, this becomes a "oh, dang!" moment basically every single time I perform anything with git.
An (optional) feature where it would be possible to let Glogg not hold the file open, while still detecting changes and reloading, would for my use case be very valuable!
The text was updated successfully, but these errors were encountered: