Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. isfileopen

isfileopen

Scheduled Pinned Locked Moved ASP.NET
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Laxmikant Lad
    wrote on last edited by
    #1

    Hi Friends I want to write some data to a text file. How can I know file is already been used by other process ? Thanking you, Laxmikant

    E C 2 Replies Last reply
    0
    • L Laxmikant Lad

      Hi Friends I want to write some data to a text file. How can I know file is already been used by other process ? Thanking you, Laxmikant

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      How do you mean:

      Laxmikant Lad wrote:

      been used by other process ?

      1 Reply Last reply
      0
      • L Laxmikant Lad

        Hi Friends I want to write some data to a text file. How can I know file is already been used by other process ? Thanking you, Laxmikant

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        use Path.GEtTempFile to get a unique filename. The only way I know to know if a file is in use, is to use a try/catch block when trying to access it. Why are you writing text files on your server ? If you have many users, perhaps a database is a better place for it ?

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups