Announcement

Collapse
No announcement yet.

What has grabbed my file?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • What has grabbed my file?

    A curious but irritating problem.

    My application running on about 300 workstations shares a data folder on a remote server. It writes regular event information to a logfile in that data folder and if two workstations try to do so simultaneously, one will get a 53 or 76 error so simply waits a few ticks and comes back for another attempt - nearly always works. If, after 50 attempts my app has not managed to write to that file, it reports an error and boots the user out. This happens very infrequently.

    However, a nosey user sniffing around the folders recently opened the common logfile with Word and then wandered away from their desk, leaving the logfile 'owned' by Word. Every ocurrence of my app then failed their 50 attempts and so effectively the app was unuseable. Very unsatisfactory.

    Only by a fluke chance was the file opened in Word discovered and closed down.

    My question is how can one identify exactly which PC/what application has opened a specific file? I'd like to be able to track back and figure exactly who has opened my logfile as no-one outside of my app should be anywhere near it.

    Has anyone else experienced this issue?

  • #2
    You could try running Lockhunter (http://www.lockhunter.com) on the server. Or if it is a real server OS, you should be able to go into admin tools and see all locks on the file. Alteernatively, give users Write and Modify rights on the log directory, but not Read rights. That way your application can still write to the log file but users can't see it and open it with another application.
    --
    [URL="http://www.camcopng.com"]CAMCo - Applications Development & ICT Consultancy[/URL][URL="http://www.hostingpng.com"]
    PNG Domain Hosting[/URL]

    Comment


    • #3
      My question is how can one identify exactly which PC/what application..
      You mean your first question was how to determine who opened the file. This has been a longstanding question here and IIRC there is some undocumented Windows function you can call which can kind of get you there. (The fact it is undocumented is why I am not going to dig any deeper for you).

      Stuart already answered your SECOND question, which was "How do I prevent this from occurring again?" I'm surprised you did not ask this as part of your original post.

      MCM
      Michael Mattias
      Tal Systems Inc.
      Racine WI USA
      mmattias@talsystems.com
      http://www.talsystems.com

      Comment


      • #4
        Maybe encrypt the logfile and when that rogue user view it with Word, he sees only rubbish and he can't modify it
        change the logfile name and also the server folder hosting this logfile, but keep the original one in the server as a decoy so that rogue user may keep on checking it
        to fool himself sily

        With this decoy on, you can also detect who the rogue user is as he would be the only one locking this decoy file. Find him and give him the sack

        Comment


        • #5
          Originally posted by Michael Mattias View Post

          You mean your first question was how to determine who opened the file. This has been a longstanding question here and IIRC there is some undocumented Windows function you can call which can kind of get you there. (The fact it is undocumented is why I am not going to dig any deeper for you).

          Stuart already answered your SECOND question, which was "How do I prevent this from occurring again?" I'm surprised you did not ask this as part of your original post.

          MCM
          Not sure why your arrogant replies are tolerated on here but quite frankly, your contempt for newbie programmers says more about your personality than it does about your technical skills.

          If you managed to fall off your high and mighty horse and either not reply or at the very least, stop poking at everyone on here that asks for help, I wouldn't be posting this.

          But to that extent, I don't need your critical advice or help. Thank you very much.

          Comment


          • #6
            Well MCM, if you can't help others it is better that you keep the comments to yourself. Giving out disparaging comments only reveals more of your inferiority complex

            Comment


            • #7
              Owen,

              He was not taking the piss out of you with the answer, outlining a strategy to find out what has happened is a normal diagnostic approach even if he was not willing to look it up for you.

              Annie dearest, its time to put your foot back in your mouth and stop saying silly things. You are not the bureau of morality yet you have a history here of trying to sit in judgement of other members.

              There are too many pseudo victims in here already, we don't need any more.
              hutch at movsd dot com
              The MASM Forum

              www.masm32.com

              Comment


              • #8
                Originally posted by Steve Hutchesson View Post
                Owen,

                He was not taking the piss out of you with the answer, outlining a strategy to find out what has happened is a normal diagnostic approach even if he was not willing to look it up for you.

                Annie dearest, its time to put your foot back in your mouth and stop saying silly things. You are not the bureau of morality yet you have a history here of trying to sit in judgement of other members.

                There are too many pseudo victims in here already, we don't need any more.
                Suggest you read back on his numerous comments to newbies that do nothing but read as outright insults upon their intelligence. Those comments were completely unwarranted and helped no-one. They continue. I do not expect anyone to look anything up for me but comments like 'You mean....' are pointless and inflamatory. I am aware of more than a few highly experienced programmers who have been considering moving to PBWin but would never bother participating in what is otherwise an extremely helpful, well moderated and polite forum. As I said earlier, I am perplexed that MM's style is tolerated by the moderators as it's the only one that reaches such lows. I do not plan to post further on this subject.

                Comment


                • #9
                  Owen,

                  Strangely enough I have no problems with my reading skills at all, I did in fact read the whole thread and have been a member of this forum since 1997 (had to re-register in 1999) and have read a vast number of threads. I have probably argued with Michael more than most people who have ever been members of this forum but it is for a reason, he has something to say based off his extensive experience and he has also been helping members of this forum for many years where people like yourself and your vocal sidekick, Annie have done little more than make a pest of yourself.

                  Your original question was a perfectly reasonable one which Stuart answered for you but you must also expect that when you post a question you may get more than one answer and as this is a peer forum and NOT a paid help desk, they may not be tailored to your expectation. Joining in this cowards club of backstabbing a member who has helped so many people who were not as fragile as you claim you are does not win you any friends here.
                  hutch at movsd dot com
                  The MASM Forum

                  www.masm32.com

                  Comment


                  • #10
                    Originally posted by Steve Hutchesson View Post
                    Owen,

                    Strangely enough I have no problems with my reading skills at all, I did in fact read the whole thread and have been a member of this forum since 1997 (had to re-register in 1999) and have read a vast number of threads. I have probably argued with Michael more than most people who have ever been members of this forum but it is for a reason, he has something to say based off his extensive experience and he has also been helping members of this forum for many years where people like yourself and your vocal sidekick, Annie have done little more than make a pest of yourself.

                    Your original question was a perfectly reasonable one which Stuart answered for you but you must also expect that when you post a question you may get more than one answer and as this is a peer forum and NOT a paid help desk, they may not be tailored to your expectation. Joining in this cowards club of backstabbing a member who has helped so many people who were not as fragile as you claim you are does not win you any friends here.
                    Steve, I had not planned to further post on this subject but your twisting of my posting #5 requires a response. Firstly, I have never questioned or criticised either MM's or any other persons superior technical knowledge on PBWin. My comment related to the level of sarcasm and putting down of newbies (like myself) in both this thread many before it. There is absolutely no need for it and I'm sure that you'll agree that people new to this forum should be encouraged to ask questions, no matter how inexperienced they are. The aloofness and arrogance so often aimed at them by MM is what my grizzle is about. And secondly, no I am not 'precious' - in my other life I work in national politics so understand what the rough and tumble of debate is but there should surely be one of three ways to encourage newbies on here: (1) belittle their lack of knowledge, (2) provide them with a polite and rational answer or (3) keep quiet.

                    I also take umbrage at your use of the word 'back-stabbing'. Were I to engage in such behaviour, the moderator would not have my true name or location. I also don't see anywhere that I have complained about the answers gratefully received in this thread (or any other thread for that matter) so your second paragraph is wholly fallacious. I have never complained about or criticised the extremely helpful advice posted on here and am the first to acknowledge that it's one of the best forums on any subject.

                    My grizzle was and remains about the repeated sarcasm and arrogance from MM aimed at others.

                    Comment


                    • #11
                      Owen,

                      Perhaps you should have made that decision BEFORE you tried to put the boot into Michael Mattias as Stuart answered your question.

                      You mean your first question was how to determine who opened the file. This has been a longstanding question here and IIRC there is some undocumented Windows function you can call which can kind of get you there. (The fact it is undocumented is why I am not going to dig any deeper for you).

                      Stuart already answered your SECOND question, which was "How do I prevent this from occurring again?" I'm surprised you did not ask this as part of your original post
                      There is nothing malicious or insulting in this comment, breaking it into 2 questions is in fact good analysis, you posted the question, Michael responded with an analysis of how to approach it given that Stuart had already answered how to resolve the issue.

                      Now if you have issues about the expression(s) that Michael uses which by my standards as an Aussie is extremely tame, the simple solution is to develop a sense of humour or apply just a little repartee as this forum is not a kindergarten, most of its members are in the upper years of their life. I have had arguments with Michael that would make your hair stand on end but I am not willing to be part of this coalition of cowardice that has kept try to backstab him by sobbing to the forum administration. I have always found Michael to be well mannered and while his sense of humour is probably as dry as mine, I have never seen him be rude or abusive to any member.

                      Best of luck with your original question, with Stuart's answer and a bit of experimentation you should be able to resolve the issue so that your software is a lot more robust.
                      hutch at movsd dot com
                      The MASM Forum

                      www.masm32.com

                      Comment


                      • #12
                        I should have added this,
                        And secondly, no I am not 'precious' - in my other life I work in national politics so understand what the rough and tumble of debate is but there should surely be one of three ways to encourage newbies on here: (1) belittle their lack of knowledge, (2) provide them with a polite and rational answer or (3) keep quiet.
                        My condolences for having to work in the American political system which has the reputation of a pit of vipers. You could take up a safer hobby like training cobras or keeping our Sydney variety of funnel web spiders around the house as pets.
                        hutch at movsd dot com
                        The MASM Forum

                        www.masm32.com

                        Comment


                        • #13
                          Use Windows' tools. On the server hosting the share:

                          - Launch mmc.exe
                          - Add Snapin "Shared Folders"
                          - Browse "Open files"

                          Comment


                          • #14
                            Many thanks Knuth, wasn't even aware of that tool. Can now see exactly which PC's are opening my logfile - the level of activity is astounding as there are at least 3-4 different PC's all opening and closing it with Avast at any time. Some of these machines don't even have my software installed (and shouldn't even see my data folder) so this is a can of worms. Thanks again.

                            Comment


                            • #15


                              He was not taking the piss out of you with the answer, .......
                              Knuth is one of those forum members who can provide good and direct answers. Kudos to you. Helping out our PowerBasic community will benefit everyone.
                              But bashing others with vulgar comments such as p*ss should not be tolerated. Well, perhaps someone's ancestry arising from the Great Penal Island
                              could be a contributing factor ???

                              Comment


                              • #16
                                Ha ha, yet another self elected member of the bureau of morality. Do you seriously thing you are in a position to measure the language of others ? What about your cowardly attacks on MCM, your endless destructive whining about PB not being a 64 bit compiler when what you know about 64 bit coding could be written on the back of a postage stamp.

                                Come on Annie dearest, time to change feet, remove the one in your mouth, tread in something horrible then put the other in your mouth.
                                hutch at movsd dot com
                                The MASM Forum

                                www.masm32.com

                                Comment


                                • #17
                                  Ladies and gentlemen, could you please continue this ...discussion... somewhere else?
                                  Torkel M. Jodalen, tel. (+47) 69252033 / 92422020
                                  ++

                                  Comment


                                  • #18
                                    Of the 17 posts made so far in this thread I would, if I had my way, remove 10 of them. The current admin is making the same mistake as the previous admin by allowing emotional contagion to spread unfettered. It needs to be nipped in the bud as soon as it appears in a thread.

                                    According to the home page of the forums the active membership is a paltry 241 and pretty much the same as it was when I stopped being an active member 11 months ago. I am a fan of PowerBASIC but I am no longer a fan of the PowerBASIC forums. There is an odour about this place like rotting flesh. I am now an active member of the FreeBASIC forums and posting there reminds me of what it was like here when I joined in 2003. The members there are courteous and it is a pleasure conversing with them. It is a different world to the one evolving here.

                                    Comment


                                    • #19
                                      For the record, since I'm probably in the same shooting gallery as Mr Mattias here, I have no problem with anybody regardless of age/time using PB/professional/hobby status. I have a problem with laziness.

                                      If the solution to your problem is the first google hit for your exact question, you dump code and say 'fix it for me' or state a problem and completely disregard everything except personally tailored code you can copy and go; I think that definitely shows a selfish disrespect for the time of the people who are helping voluntarily and you deserve to be called out on it. This is doubly so for this specific forum since there's a relatively gigantic archive of working-in-at-least-some-fashion real code on the source code board thats about three clicks away,

                                      The reason most other language specific forums admonish for showing no effort isn't because they're nasty, hostile places; it's that it helps keep the language living. If all you can do is get handouts, who are you in a position to help or evangelize to? If a co-worker or somebody sees you struggling with a tool you don't know how to use, it's not going to engender them to pick it up themselves. Niche languages need word of mouth.

                                      Also for Mr English's record, I don't count this thread amongst the above statements.

                                      I am now an active member of the FreeBASIC forums and posting there reminds me of what it was like here when I joined in 2003. The members there are courteous and it is a pleasure conversing with them. It is a different world to the one evolving here.
                                      Probably not dissimilar to how this place was at the time Big Bob passed. Knowing they're onto a loser using a dying language, no matter how stable the tools (such as FreeBasic is, for now at least), leads to people caring less. Nobody wants to be associated with failure. So if nobody replaces the FB devs, that forum will go the same way too. At least FB is open source, though I notice the 'what shall we do' thread is already rife with laziness, everybody wants this and that to be done but has excuses out the wazoo why they can't do it themselves.

                                      Comment


                                      • #20
                                        Originally posted by Bob Carver
                                        So if nobody replaces the FB devs, that forum will go the same way too.
                                        There seems to be a distinct possibility of that, Bob. However, I think that both forums will survive but will have an asymptotic decline provided, of course, that someone keeps paying the electricity bills.

                                        Whilst it would be sad to see both forums head in that direction for those who are not lazy it would not be the end of the world. I have made a point of getting to understand how to write dlls in PB for FB and vice versa. In this respect PB is better at handling a FB dll than vice versa. I am not an expert in SDK but am more than able to write some decent GUIs with DDT. I have done some stuff with FB that would not be an easy port to PB, the things that can be done with UDTs is amazing, but that stuff can esaily be coded as a dll. PB plus FB or FB plus PB is a potent combination. Of course, we are talking 32 bit here but I have read enough about 64 bit to understand that I do not need it. I don't write any FB stuff in 64 bit.

                                        For the lazy folk they would be like a duck out of water. One thing for sure, they would not get any sympathy from me, and is it not the lazy ones who do most of the whining; not unlike folk who do not bother to vote in general elections and are the loudest complainers of their government.

                                        It is a shame that Gary Beene stood down. What Gary should have had was two or three lieutenants more than willing to stand shoulder to shoulder with him. I would have volunteered to be the forum executioner and would not have expected any coin in providing a clean severance.

                                        Comment

                                        Working...
                                        X