1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Sharing write permission in a windows workgroup

Discussion in 'Networking (Hardware & Software)' started by pavs, 2006/11/30.

  1. 2006/11/30
    pavs

    pavs Inactive Thread Starter

    Joined:
    2006/11/30
    Messages:
    1
    Likes Received:
    0
    Hi,
    I am sharing a text file in my windows workgroup. The original file is Windows 2003 server and all the other clients in the workgroup are windows xp. Everyone has admin rights to the file. The problem with the text file is that I have a program installed in all my clients and the server who simultaniously reads the file and (supposedly) writes on the file simultaneously too. As far as I know it is not possible to write at the same time. Because of the nature of the program and the problem, I need to know if four programs tries to write the file at the same time (the programs don't delete anything or writeover other texts, it just writes a new line everytime it need to write something) or does only the last program (user) gets to write on the text file or all the write command gets queued up and written one by one.
    There is no way to verify which line is written by which program (user) or when it was written.

    If all programs are not able to write at the same time (or one after another), I need to know if there is a workaround for this.

    Thanks for any help.
    pavs
     
    pavs,
    #1
  2. 2006/11/30
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    This sounds to me like a recipe for disaster.

    I may be wrong but I don't think text files are written in the way you suggest. When you add a line, you don't just append the line to the file, you read the file in, add the extra line and then overwrite the previous file with a new version of the file with the line added.

    Therefore, the issue is that if multiple agents try to write a file at the same, they are all trying to write their own version of the file. So only one will be successful.

    If you have direct access to the file, there may be away to get around the problem, but I don't think you can via simple file update over a network.

    What are you trying to do? Why do so many systems need to write to the same file? There may be a better way of approaching the problem.

    It sound to me like you are trying to use a single user application as a network application and are finding out why this often isn't a good idea.
     

  3. to hide this advert.

  4. 2006/11/30
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,068
    Likes Received:
    396
    Sounds like what is needed is a database.
     
  5. 2006/12/02
    Bill Castner

    Bill Castner Inactive

    Joined:
    2006/08/30
    Messages:
    1,980
    Likes Received:
    0
    What exactly is being recorded?

    Most activites such as logon/logoff, and other connection details can be recorded by the use of the Audit feature of XP.

    There is a ton of utilities that can be scheduled to draw on invidivual workstation Audit details from the Event Logs, and combined, on a Scheduled basis.

    If you are using a .CMD or .BAT file to record specific workstation details, this can be done through perfmon and its extensive catalog of possible recordable events.

    As said above, most database programs would allow a Text field. This can in most cases be scripted as for the write; the general principle is that a network aware application preserves the existing state of the file, locks the file, does the write, and unlocks the file. A network aware application would then follow this format:

    . preserve existing data set
    . lock the file for a write
    . write to the file
    . unlock the file

    A database aware client would:

    . preserve the existing data set
    . attempt a lock
    . if successfull, do the write
    . if unable to lock, start again with step #1 to preserver the data set
    . unlock the file

    This is relatively easy to do if the activity is just an Add rather than an Edit of existing records.

    But please see what perfmon can do. And see what Windows provides as tools to aggregate permon statistics accross a Workgroup or Domain. I suspect the tools you need already are in place.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.