Windows renaming files with extension tmp1 when dragging them to network share from desktop

Posted on 2011-10-18
Last Modified: 2012-05-12
Hi all,

I am currently using a FileSystemWatcher object in .NET to monitor a network share for newly created files. I was testing my application and it was working fine when I was creating new files in the network share (I was dragging and dropping from my desktop). However when I tested for a slightly larger file (approx 165KB) I noticed that when I dragged the file over, windows renamed the test.xml file to test.xml.tmp1 for a few seconds and then the file is renamed back to its original name.

The problem for me here is that the file.created event does not fire now in the FileSystemWatcher object. I may have to go down the route of monitoring for the renamed event but was wondering does anybody know why this is happening and any better solutions to the one I propose.

System: Win XP (64 bit), .NET 4.0, c#

Many thanks

Question by:basil365
    1 Comment
    LVL 28

    Accepted Solution

    During a file copy from windows to a network share, the file may take a while to move (as you've seen). If you chose to cancel or a crash occurs, only part of the file would exist on the share which might indicate that the transfer was successful even though the file is corrupt.

    To prevent this, Windows has added the temporary extension to transfer the file until it is complete and then performs the rename. A faster network would fix this or using the rename event watcher as you mentioned.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
    If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video discusses moving either the default database or any database to a new volume.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now