Tom Ramcigam (magicmarmot) wrote,
Tom Ramcigam


Two separate programs, two separate operating systems, both dealing with the same file. One is writing, the other is reading.

Unfortunately the one that is reading has a higher priority, so it attempts to read the file before it is completely written.

Best way to deal with the problem would be to create a file resource lock (semaphore), but with the current structure of one of the programs, that gets really icky. File access points are scattered all over the place.

My fix: in the reader program, check to see if the file exists, and sleep if it doesn't. In the writer, write a temporary file and rename it when it's done. Gonna see if that works.
Tags: codegeek

  • (no subject)

    It finally happened. It had to, really. I was in the bottom two cut from LJ-Idol this week. I made it to the top 50, from some rather larger…

  • Mayville

    "Too many bats in the belfry, eh?" The question came from a small man in the scrubs-and-robe garb of an inmate. He looked a little like a garden…

  • LJ-Idol

    Another batch of entries. Consistently amazed at how good the writing is. Voting is open for…

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.