[algo] Algo for naming of duplicate/clone "objects" ?
-
(if you can suggest a better subjet text...) In Windows Explorer when you copy/paste a file in a folder you will have something like: test.txt test - Copy.txt test - Copy (2).txt test - Copy (3).txt ... and if you copy/paste test.txt test - Copy.txt test - Copy - Copy.txt test - Copy - Copy (2).txt Is there a known (described in the Windows UI guideline) algorithm for that? Is it simple brute force search for the "next valid" name ? Thanks. Max.
Watched code never compiles.
-
(if you can suggest a better subjet text...) In Windows Explorer when you copy/paste a file in a folder you will have something like: test.txt test - Copy.txt test - Copy (2).txt test - Copy (3).txt ... and if you copy/paste test.txt test - Copy.txt test - Copy - Copy.txt test - Copy - Copy (2).txt Is there a known (described in the Windows UI guideline) algorithm for that? Is it simple brute force search for the "next valid" name ? Thanks. Max.
Watched code never compiles.
-
Huh? :confused:
Watched code never compiles.
-
(if you can suggest a better subjet text...) In Windows Explorer when you copy/paste a file in a folder you will have something like: test.txt test - Copy.txt test - Copy (2).txt test - Copy (3).txt ... and if you copy/paste test.txt test - Copy.txt test - Copy - Copy.txt test - Copy - Copy (2).txt Is there a known (described in the Windows UI guideline) algorithm for that? Is it simple brute force search for the "next valid" name ? Thanks. Max.
Watched code never compiles.
The way that Windows names files on clash depends on your Windows version. Easiest way to duplicate this is by getting the filename, and checking if there's an entry in the same directory with that constant attached; SomeDocument.docx OtherFile.txt Dialogs.bin SomeDocument - Copy.docx Desktop.ini Iterate the files, check for the constant - and add 1 to the value if appropriate. AFAIK, there's no existing API that does this for you. If there is, I definitely like to know :)
Bastard Programmer from Hell :suss:
-
The way that Windows names files on clash depends on your Windows version. Easiest way to duplicate this is by getting the filename, and checking if there's an entry in the same directory with that constant attached; SomeDocument.docx OtherFile.txt Dialogs.bin SomeDocument - Copy.docx Desktop.ini Iterate the files, check for the constant - and add 1 to the value if appropriate. AFAIK, there's no existing API that does this for you. If there is, I definitely like to know :)
Bastard Programmer from Hell :suss:
Yeah, that's what I tought. Thanks.
Watched code never compiles.