Answer the question
In order to leave comments, you need to log in
What algorithm is used to create a folder if the folder exists?
I use Linux Mint with xfce4. If you press "right click" - "Create directory" and there is already a folder with the same name in the current directory, a dialog box appears:
which is very annoying.
I downloaded the Thunar sources and found places in the code where the right click occurs, various checks when creating a directory, and the creation of a directory itself. I played around with the code a bit, my edits work (how cool it is when the code is open!). I want to change the Thunar code so that if the "New directory" directory exists, "New directory (1)" is created, etc., as it is done in windows:
I just can't figure out how to implement it. Who can give an algorithm, or an example in C, or an example in pseudocode. Thank you.
PS: I'm downloading the ReactOS sources, I'll try to look there...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question