Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 440197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:50:55+00:00 2026-05-12T20:50:55+00:00

I have written a service that monitors a file drop location for files from

  • 0

I have written a service that monitors a file drop location for files from a scanner. The scanner drops all files with the exact same file name (eg. Test.tif) unless that file already exists and then it appends on a timestamp on the end (eg. Test_0809200915301900.tif).

So when I process these files I attach a ‘tag’ to the db entry to reflect this specific file which is the filename plus the file creation timestamp in ticks. Each scanner can produce 1 scan every few seconds at best so precision to the second is sufficient.

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 would look something like: Test1.tif_633931295923017954

For some reason though when a bunch of scans come in from the same scanner say over the course of 20 seconds (eg. 1 scan, then 5 seconds later another, then 5 seconds later another, etc) the are getting the exact same file creation time stamp.

Eg.

  1. File in: Test1.tif
  2. Picked up and stored with tag Test1.tif_633931295923017954
  3. Test1.tif is deleted.
  4. File in: Test1.tif (5 seconds later)
  5. Picked up and fail to be stored because generated tag is a duplicate with Test1.tif_633931295923017954

How is this possible? The ticks are identical. I inspected the creation time object and it is identical as well even though I physically saw it created 5 seconds after the first one.

Edit: Can anyone recommend a solution to ensuring I am dealing with a unique file? I thought that filename + creation timestamp should be a good enough check but obviously it is not. I don’t have the ability to turn off the ‘Tunnelling’ functionality that Windows is preforming.

Edit: I ended up having the process rename each file and appending a guid. The process that then processed the files looked for files with the guid attached only. This ensured only unique files were processed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:50:55+00:00Added an answer on May 12, 2026 at 8:50 pm

    This is a feature of Windows called File System Tunneling, and is expected behavior. Essentially this is an operating system working around for software that deletes a file and writes a new one when a user edits and save a file. The user expects the file creation time of the edited file to be the same as the original, and the software may require that the “short” version of the file name to remain the same before and after the edit so Windows fakes it.

    For more details, please see: The apocryphal history of file system tunnelling for more details.

    Edit:
    I’m surprised that FileSystemInfo.LastWriteTime as Feaderne suggested didn’t work.
    Can you leave File1.tif as-is and watch for the creation of the unique files in the directory using FileSystemWatcher, pattern match the newly created files, and copy them using your naming scheme?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a service, written in C#, that monitors a set of files. It
I have a Windows Service written in C# that handles all of our external
I have an windows service that monitors a folder for new files being created.when
I have written a web service that reads from a message queue . This
I have written a simple service that uploads & downloads XML files. I want
I have a Windows service written in C# which monitors a folder for files
I have written a Windows service that I am needing to port over to
I have written a custom Windows Service that writes data to a custom Event
I have written a simple WCF service that accepts and stores messages. It works
I have a new service that I have written and need to register it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.