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

  • SEARCH
  • Home
  • 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 3661964
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:21:48+00:00 2026-05-19T01:21:48+00:00

This is what I’m trying to do : Download a file (txt, doc, xls,

  • 0

This is what I’m trying to do :

  1. Download a file (txt, doc, xls, whatever) from a server
  2. Open the file with the appropriate application using System.Diagnostics.Process.Start(path to file)
  3. Monitor for file changes using a FileSystemWatcher.
  4. Each time the file is changed, upload the file back to the server
  5. Continue monitoring until the user has finished editing the file
  6. Delete the local copy of the file
  7. Exit the application

I’m stuck at step 5. How can I know whether a user has finished working on a file ?

I cannot rely on the file being locked (notepad doesn’t lock txt files for example).

I cannot rely on a process having exited or not (an example is Notepad++ for txt files : the file could be open in a tab. When you close the tab, you’ve finished editing the file, but the process is still running)

Any idea/points on how to do that in C# ?

  • 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-19T01:21:49+00:00Added an answer on May 19, 2026 at 1:21 am

    You’ve excluded the two ways you could go about detecting the file being in use: file locking, and the process you start exiting.

    The only alternative I an think of is to display a dialog to ask the user when they’ve finished editing.

    Edit: For what it’s worth – FileZilla has this type of behaviour. You can choose to edit a file on the remote server, it downloads the file, launches the default editor, and (in the background) shows a “If you’ve finished editing – Click OK” button.
    This gives me the opportunity to cancel an edit, if I’ve mucked up the file and saved it.

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

Sidebar

Related Questions

This is the file auth.txt (username password) paolo 1234 luca 0000 marci 1000 And
This is my first time using Magento. I upgraded this site from 1.4.1.1 to
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
This is an example of the code am using. I use a modified version
This question is quite specific. I'm using Symfony2 White October Admin Bundle for generating
This is as close as I've gotten to successfully populating an expandable listview from
I am trying to render a haml file in a javascript response like so:
This should not be so complicated: I am using Easiest Tooltip and Image Preview
This is what i tried . In my view.py file , import logging logger

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.