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

added truncate file option to context menu #146

Draft
wants to merge 5 commits into
base: Development
Choose a base branch
from

Conversation

jsuppe
Copy link

@jsuppe jsuppe commented Dec 3, 2019

I had found myself deleting the log file(s) repeatedly to get clean view for certain log files, especially when filters would be capturing too much. This option to truncate that log file improved my workflow.

Copy link
Collaborator

@Hirogen Hirogen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to take the possible exceptions into account, and what happens if those occur, for instance IOException if the file, for whatever reason could not be open / written, etc.

@zarunbal
Copy link
Owner

The easier way would be in my opinion to use the "external tools" feature. There you can launch any executable or e.g. cmd.exe with some commands.

@den-rain
Copy link

I can vote for the feature to truncate a log file! It will be very helpful.

@Hirogen Hirogen added the Feature what a great idea label Nov 11, 2021
Hirogen added 3 commits July 20, 2022 08:49
added credits
updated the readme a bit
@jsuppe jsuppe requested a review from Hirogen July 24, 2022 14:47
@jsuppe
Copy link
Author

jsuppe commented Jul 24, 2022

New update to this branch checks for the file lock and writes to status what the process holding the lock is named. Also, this is now described as "try to" truncate, because it is not guaranteed. This change only aims to address when exception may be thrown due to trying to exclusively obtain write lock on file that already has lock and would then cause an exception.

@jsuppe jsuppe marked this pull request as draft July 24, 2022 14:58
@Hirogen
Copy link
Collaborator

Hirogen commented Jul 24, 2022

please merge the latest changes from the development branch, you got over 200 files, that would change back to an older version if I accepted that MR.

Something is off, i see you did merge the dev branch to yours, but regardless there are many changes that would be reverted to an older version :(

sorry, I just saw, that you reverted the merge from development, thats why all the changes popup

@jsuppe jsuppe force-pushed the branches/truncate-file-menu-option branch from c123dc6 to 536840b Compare July 26, 2022 00:13
jsuppe added 2 commits July 25, 2022 20:23
Added LockFinder project, to check processes holding file lock during truncate
Added Status Line to tell user if something didn't work
Renamed method and tooltip to indicate Truncate is not guaranteed
@jsuppe jsuppe force-pushed the branches/truncate-file-menu-option branch from 536840b to 906befa Compare July 26, 2022 02:24
Copy link
Collaborator

@Hirogen Hirogen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the late answer, could you please add unit testcases, otherwise it looks ok

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

Successfully merging this pull request may close these issues.

4 participants