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

add no-clobber flag #827

Merged
merged 4 commits into from
Jun 3, 2024
Merged

add no-clobber flag #827

merged 4 commits into from
Jun 3, 2024

Conversation

dogancanbakir
Copy link
Member

@dogancanbakir dogancanbakir commented Mar 28, 2024

Closes #749

This PR modifies the behavior of the store-response-dir directory creation. With the new -no-clobber flag, the directory will be created as is if there are no existing directories. However, if directories already exist, it will increase the number suffix of the given directory or add a new suffix. When removing directories, all created directories will be removed.

@dogancanbakir dogancanbakir requested a review from Mzack9999 March 28, 2024 14:12
@dogancanbakir dogancanbakir self-assigned this Mar 28, 2024
@dogancanbakir dogancanbakir linked an issue Mar 28, 2024 that may be closed by this pull request
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

Discussing internally if a behavior like wget overwrite/no-clobber would be a good fit

@dogancanbakir dogancanbakir force-pushed the introduce_incremental_crawling branch from f95ee1e to 26f87d8 Compare April 18, 2024 09:11
@dogancanbakir dogancanbakir changed the title introduce incremental crawling add no-clobber flag Apr 18, 2024
@dogancanbakir dogancanbakir requested a review from Mzack9999 April 18, 2024 09:12
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

lgtm - The current implementation acts by increasing the folder name version number if an existing one is detected.

$ go run . -ncb -srd test -u http://scanme.sh
$ ls


    Directory: C:\Users\user\go\src\github.com\projectdiscovery\katana\cmd\katana


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        29/04/2024     14:42                test
d-----        29/04/2024     14:42                test1
d-----        29/04/2024     14:46                test10
d-----        29/04/2024     14:46                test11
d-----        29/04/2024     14:43                test2
d-----        29/04/2024     14:43                test3
d-----        29/04/2024     14:44                test4
d-----        29/04/2024     14:44                test5
d-----        29/04/2024     14:45                test6
d-----        29/04/2024     14:45                test7
d-----        29/04/2024     14:45                test8
d-----        29/04/2024     14:46                test9

@Mzack9999 Mzack9999 requested a review from ehsandeep April 29, 2024 12:57
@Mzack9999 Mzack9999 added the Type: Enhancement Most issues will probably ask for additions or changes. label Apr 29, 2024
@Mzack9999 Mzack9999 merged commit 3a0a295 into dev Jun 3, 2024
14 checks passed
@Mzack9999 Mzack9999 deleted the introduce_incremental_crawling branch June 3, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add -no-clobber to avoid overwriting files that already exist
2 participants