scanner
scanner copied to clipboard
Check if file exists already and append _1,_2,_3,... to it.
Problem: At the moment, if a a file already exists, it's overwritten by the app. Suggestion: If a file exists already, the app should append _1,_2,_3,... to it.
Example: SCN_20221124.pdf exists already. The next scan on the same date would overwrite this file. SO the next scan should be named SCN_20221124_1.pdf
This is not supposed to happen, could you please append a log file and ideally identify the time (hour & minute) at which an existing file was overwritten so I can match it to the log?
While I was planning to streamline the file naming for name collisions at some point, Windows is currently supposed to generate a unique name and prevent Scanner from overwriting existing files.
Sorry for the late answer.
I played around a bit, but it's still the same. When using the same output name (like 2 scans on the same date with only the date as file extension, the already existing file is overwritten.
I had a look at your log files and appended a file with the described situation. I marked the beginning of the two scans with en empty line (line 168 and 193 in the appended file), so you can find them faster.
The interesting part seems to be this one (cut&paste from second scan starting at line 193)
"Creating a ScanResult with conversion from {SourceFormat} to {TargetFormat} from {Num} pages.","Properties":{"SourceFormat":".jpg","TargetFormat":"Pdf","Num":1}}
"ScanResult constructor [futureAccessListIndexStart={Index}]","Properties":{"Index":0}}
"All image files of the scan result have been requested."}
"Requested PDF generation."}
"PDF doesn't exist yet."}
"Requested PDF generation."}
=> The file SCN_20221216.pdf from the first can (line 168) existed at this moment!
"Launching full trust process."}
"Full trust process is done."}
"Requested to move file to folder. [desiredName={Name}|replaceExisting={Replace}]","Properties":{"Name":"SCN_20221216.pdf","Replace":true}}
=> Replace is set to TRUE, so I guess it's clear, that the old file will be replaced/overwritten 😄_
Is there any setting to set replace to FALSE, that I missed?