I wrote a service that tracks the file location for files from a scanner. The scanner discards all files with the same file name (for example, Test.tif) if this file does not already exist, and then it is added to the time stamp at the end (for example, Test_0809200915301900.tif).
Therefore, when I process these files, I attach a “tag” to the db record to reflect this particular file, which is the name of the file, as well as the timestamp of the creation of the file in ticks. Each scanner can produce 1 scan every few seconds, at best, so that the accuracy is second.
Here is the code that generates this supposedly unique tag:
FileInfo fileInfo = new FileInfo(filePath);
string tag = string.Format("{0}_{1}", filename,
fileInfo.CreationTimeUtc.Ticks.ToString());
The generated tag will look something like this: Test1.tif_633931295923017954
For some reason, although when scanning from the same scanner, scanning takes 20 seconds (for example, 1 scan, then after 5 seconds another, then after 5 seconds, etc.), the exact same mark is obtained file creation time.
Eg.
- File in: Test1.tif
- Picked up and saved with tag
Test1.tif_633931295923017954 - Test1.tif has been deleted.
- File in: Test1.tif (after 5 seconds)
- It is matched and not saved, since the generated tag is a duplicate of
Test1.tif_633931295923017954
How is this possible? Ticks are identical. I checked the time creation object and it is also identical, although I physically saw it within 5 seconds after the first.
: - , ? , + , , , . "Tunneling", Windows.
: guid. , , . .