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 6226757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:05:30+00:00 2026-05-24T09:05:30+00:00

I want to provide my users with the ability to post a log file

  • 0

I want to provide my users with the ability to post a log file onto my server rather than requiring them to find it and email it to me.

I am using this library http://ftplib.codeplex.com/ to open an ftp session on the server and send the file. There is a bit of renaming involved but that is it.

Unfortunately the log file to be sent is actually open so I got a ‘file is being used by another process’ exception. This makes sense when I think about it in so far as the log is open while my app is running. I closed it but, of course, uploading is a long process. I put the upload code into a background thread so that the user may continue. However the log cannot be re-opened until the upload is complete. In the meantime there could be some event that should be written to the log.

So I am looking for a way to copy the log and then upload it. What would be the best way to do that? The log is a binary file BTW.

  • 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-24T09:05:31+00:00Added an answer on May 24, 2026 at 9:05 am

    If you don’t own the code that has the log file open (ie, it’s another app or a closed source dll), you can try doing a File.Copy(<log>, <tempdest>) and send that file, deleting it when you’re done. This only sometimes works when you don’t have read access to the file.

    If you do own the code that is accessing the file in the first place, you want to open it with an explicit ShareMode ie

     File.Open(path, FileMode.Open, FileAccess.ReadWrite, FileShare.Read)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say you have an app, that you want to provide users ability to browse
Situation: I want to provide a website service where users can enter some data
I want to be able to provide a button to my users to just
I want to provide the ability to save some rendered data/charts (with the titles
I want to provide the user the ability to save personal data encrypted. This
I'm developing a Twitter application on OAuth and I want to provide the ability
Im making an application where i want to provide the user with the ability
I want to develop a Web App for Mobile users, which will provide users
I want to provide my user with some meaningful error messages when network requests
I want a desktop application to provide a smooth user experience through deployment. In

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.