• Pascal with Mystic Log Files

    From Dan Richter@1:317/3 to All on Mon Jul 9 12:49:11 2018
    Hi All,

    I was just wondering something, as I've run into a slight bump-in-the-road in one of my programs.

    What I'm doing, is reading the Mystic log files to obtain information for various reports. On my Windows system, which is running fsxNet hub 4, I've noticed that I'm getting errors while trying to read the mis.log file. The program is unable to open the file based on permissions...

    snip<=-

    Project rcsnodepoll raised exception class 'RunError(5)'

    In file 'rcsnodepoll.pas' at line 174:
    reset(fmislog);

    snip<=-

    Then I'll get:

    snip<=-

    Project rcsnodepoll raised exception class 'EInOutError' with message:
    Access denied

    In file 'rcsnodepoll.pas' at line 174:
    reset(fmislog);

    snip<=-

    When run from a command line, I'm getting: 'File handling error occurred. Details: Access denied'.

    My question, does Windows handle file permissions differently than Linux? I
    can run this all day long on the Linux system with no problems. It just when
    I try on the Windows system that I start having issues.

    Here is also a snippet of the code that includes line 174:

    snip<=-

    If FileExists(MysticLogs+'mis.log) then
    Begin
    Try
    AssignFile(fmislog,MysticLogs+'mis.log');
    reset(fmislog); //This is line 174
    except
    On E: EInOutError do begin
    writeln('File handling error occurred. Details: ',E.Message);
    ProgramHalt;
    end;
    end;
    end
    else
    begin
    writeln('mis.log not found. Exiting...');
    ProgramHalt;
    end;

    snip<=-

    I'm guessing that Mystic is keeping the files locked, so it can keep writing
    to them. I just don't have any issues with this under Linux...

    What I will probably have to do, is make a copy of the log files, read them, then delete the copies, if Windows is the OS. Is there a better way of doing this?

    Any help would be greatly appreciated.


    ---

    Black Panther
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS (RCS)
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (1:317/3)
  • From Ian Thurston@1:218/640 to Dan Richter on Tue Sep 11 00:00:44 2018
    I'm guessing that Mystic is keeping the files locked, so it can keep writing to them. I just don't have any issues with this under Linux...

    I believe it is locked while Mystic has it open. I had this problem when I wrote an interface to monitor the message queue of a delivery system over HF radio, the program used to deliver the MAPI messages locked all the files so
    I had to copy them to a temp location in order to parse their headers.

    What I will probably have to do, is make a copy of the log files, read them, then delete the copies, if Windows is the OS. Is there a better
    way of doing this?

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: The Vista BBS - Vallejo, CA USA (1:218/640)