• A project i'm working on..

    From ignatius@VERT/CYBERIA to All on Sat Jan 10 10:18:00 2015
    Hello,

    I've successfully ported Impuluse BBS from DOS to Linux. HOWEVER, there
    are still some bugs that need to be worked out. One of those bugs involves posting messages. This is a function i'm currently having troubles with.
    I get the following error, "Not enough disk space to save a message." I
    believe it has to do with Linux not handling drives like DOS does. If someone could take a look at this, i'd really appreciate it.

    Thank you for your time.

    -ig

    -//-snip-------------------------------------------------------------
    procedure inputthemessage;
    var tmp,t1:integer;
    begin
    ansmsg:=false;
    cmdsoff:=FALSE;
    abort:=FALSE;
    next:=FALSE;
    ptl1:=TRUE;
    goquote:=FALSE;
    quoteli:=1;
    if (freek(exdrv(status^.msgpath))<status^.minspaceforpost) then begin
    mftit:='';
    nl;
    print('Not enough disk space to save a message.');
    c:=chr(exdrv(status^.msgpath)+64);
    if (c='@') then sysoplog(#3#8+'- '+#3#3+' Main BBS drive full! Insuffici nt space to save a message!')
    else sysoplog(#3#8+'- '+#3#3+' '+c+': drive full! Insufficient space t
    save a message!');
    end else begin
    lc:=1;
    spc:='
    ';
    lastline:='';
    maxli:=status^.maxlines;
    ptl;
    if (pynq(strings^.uploadmsg,false)) then ansmsg:=true;
    end;
    if (not ansmsg) then begin
    if (mftit='') then
    if (not cantabort) then begin
    save:=FALSE;
    exit;
    end;
    printmsgtitle;
    repeat
    repeat
    saveline:=TRUE;
    {nofeed:=FALSE;}
    { exited:=FALSE;
    save:=FALSE;
    abortit:=FALSE;
    write_msg:=TRUE;
    curx:=wherex;
    cury:=wherey;
    inli(s);
    write_msg:=FALSE;
    if (s='/'^H) then begin
    saveline:=FALSE;
    if (lc<>1) then begin
    dec(lc);
    lastline:=li^[lc];
    if (copy(lastline,length(lastline),1)=#1) then
    lastline:=copy(lastline,1,length(lastline)-1);
    if (cury>topy) then goxy(curx,cury-1);
    end;
    end;
    if (s='/') then begin
    sprompt(strings^.fseprompt);
    getkey(c);
    for t1:=1 to length(strings^.fseprompt) do
    prompt(^H' '^H);
    saveline:=FALSE;
    case upcase(c) of
    '?','H':printf('prhelp');
    'A':if (not cantabort) then
    if pynq('|U3Abort message? ',false) then begin
    exited:=TRUE;
    abortit:=TRUE;
    end;
    'C':if pynq('|U3Clear message? ',false) then begin
    printmsgtitle;
    lc:=1;
    end;
    'L':listit(1,pynq('|U7List message with line numbers? ',true),TRUE)

    'Q':if (exist('msgtmp')) then goquote:=true;
    'S':if ((not cantabort) or (lc>1)) then begin
    exited:=TRUE;
    save:=TRUE;
    end;
    'T':ptl;
    end;
    end;

    if (goquote) then begin
    doquote;
    goquote:=FALSE;
    cls;
    printmsgtitle;
    if (lc>1) then
    if (lc>10) then listit(lc-10,FALSE,FALSE)
    else listit(1,FALSE,FALSE);
    end;

    if (saveline) then begin
    li^[lc]:=s;
    inc(lc);
    tmpy:=wherey;
    if (tmpy>=22) then begin
    goxy(1,topy);
    for tmp:=topy to tmpy do sprint(#27+'[K');
    goxy(1,topy);
    for tmp:=lc-10 to lc do print(li^[tmp]);
    goxy(1,wherey-1);
    end;
    if (lc>maxli) then begin
    print('You have used up your maximum amount of lines.');
    exited:=TRUE;
    end;
    end;
    until ((exited) or (hangup));
    if (hangup) then abortit:=TRUE;
    if ((not abortit) and (not save)) then
    begin
    sprint('Maximum number of lines reached.');
    nl;
    if (pynq('Save? ',false)) then save:=true else abortit:=true;
    end;
    until ((abortit) or (save) or (hangup));
    if (lc=1) then begin
    abortit:=TRUE;
    save:=FALSE;
    end;
    end else
    begin
    save:=false;
    if (not outcom) then begin
    sprompt(strings^.enterfilenametoul);
    s:='';
    mpl(40);
    inputl(s,40);
    if (exist(s)) then begin
    assign(ansfile,s);
    reset(ansfile);
    assign(tempmsg,'temp2.msg');
    rewrite(tempmsg);
    append(tempmsg);
    while (not eof(ansfile)) do begin
    readln(ansfile,ansline);
    writeln(tempmsg,ansline);
    end;
    close(ansfile);
    close(tempmsg);
    save:=true;
    end;
    end else begin
    receive1('temp2.msg',false,gotit,temp1,temp2);
    if (exist('temp2.msg')) then begin
    assign(tempmsg,'temp2.msg');
    reset(tempmsg);
    close(tempmsg);
    save:=true;
    end;
    end;
    end
  • From wkitty42@VERT/CYBERIA to ignatius on Sat Jan 10 23:41:00 2015
    On 01/10/15, ignatius said the following...

    if (freek(exdrv(status^.msgpath))<status^.minspaceforpost) then begin

    write a simple couple of lines testing program using this status^.minspaceforpost routine and see what it returns... or go deeper into that routine and break out the main part of it that does the available space lookup and see what that returns...

    --- Mystic BBS v1.10 A59 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From Ree@VERT/FTELNET to ignatius on Mon Jan 12 04:01:07 2015
    I've successfully ported Impuluse BBS from DOS to Linux. HOWEVER, there are still some bugs that need to be worked out. One of those bugs involves posting messages. This is a function i'm currently having troubles with.
    I get the following error, "Not enough disk space to save a message." I believe it has to do with Linux not handling drives like DOS does. If someone could take a look at this, i'd really appreciate it.

    The first thing I'd do is look into freek() to see what size the return variable is, and if it's wrapping.

    ---
    þ Synchronet þ R&M Software Support BBS
  • From ignatius@VERT/CYBERIA to wkitty42 on Wed Jan 14 06:56:00 2015
    write a simple couple of lines testing program using this status^.minspaceforpost routine and see what it returns... or go deeper into that routine and break out the main part of it that does the available space lookup and see what that returns...


    It doesn't return anything. :(

    --- Mystic BBS v1.10 A59 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From ignatius@VERT/CYBERIA to ignatius on Wed Jan 14 07:41:00 2015
    It doesn't return anything. :(


    On a related note, what is a good substitute for the "diskfree" function
    under Linux? I believe this may be the root of my problems.

    TIA,
    ig

    --- Mystic BBS v1.10 A59 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From wkitty42@VERT/CYBERIA to ignatius on Sun Jan 18 00:53:00 2015
    On 01/13/15, ignatius said the following...

    write a simple couple of lines testing program using this status^.minspaceforpost routine and see what it returns... or go deep into that routine and break out the main part of it that does the available space lookup and see what that returns...

    It doesn't return anything. :(

    well that could be a problem... what i was actually looking for was if you might have been seeing wrap around due to using a signed integer variable instead of an unsigned one or one large enough to hold the returned value... i've got old code here that works with 2G but fails on anything larger... now i've also got a shiny new 1TB drive that i gotta recode stuff for but that's also going to entail writing cross platform since i'm mostly linux now except for the bbs machine which is still OS/2 ;)

    --- Mystic BBS v1.10 A59 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From wkitty42@VERT/CYBERIA to ignatius on Sun Jan 18 00:54:00 2015
    On 01/13/15, ignatius said the following...

    It doesn't return anything. :(

    On a related note, what is a good substitute for the "diskfree" function under Linux? I believe this may be the root of my problems.

    what language?

    --- Mystic BBS v1.10 A59 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood,
  • From ignatius@VERT/CYBERIA to wkitty42 on Sun Jan 18 06:00:00 2015
    what language?


    Free Pascal.

    --- Mystic BBS v1.10 A59 (Linux)
    * Origin: Cy
  • From wkitty42@VERT/CYBERIA to ignatius on Wed Jan 21 20:37:00 2015
    On 01/17/15, ignatius said the following...

    RE: diskfree routine

    what language?

    Free Pascal.

    interesting... i'll take a look since that's one of my areas of play... what
    OS are you compiling for?

    --- Mystic BBS v1.10 A59 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX
  • From ignatius@VERT/CYBERIA to wkitty42 on Thu Jan 22 00:13:00 2015
    interesting... i'll take a look since that's one of my areas of play... what OS are you compiling for?

    Linux (IA 32)

    -ig

    --- Mystic BBS v1.10 A59 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org |
  • From wkitty42@VERT/CYBERIA to ignatius on Sun Jan 25 19:55:00 2015
    i've finally had a chance to look at this... sorry for the delay...

    On 01/13/15, ignatius said the following...

    On a related note, what is a good substitute for the "diskfree" function under Linux? I believe this may be the root of my problems.

    i don't think this is your problem... try this little command line program from the FPC help when i hunted down the diskfree routine to find out what unit it was stored in... if the four default drives don't cover everything needed on one's *nix box, there's an addfile routine to add them with their own id number... this because *nix references drives as files and the diskfree
    routine (along with others) want a drive id byte... so anyway, here's the code... give it a try... simple command line program...

    program diskfree_test;

    uses
    sysutils;

    begin
    write ('Size of current disk : ',DiskSize(0));
    writeln (' (= ',DiskSize(0) div 1024,'k)');
    write ('Free space of current disk : ',DiskFree(0));
    writeln (' (= ',DiskFree(0) div 1024,'k)');
    end.

    typos are mine as i couldn't figure out how to get netrunner to let me put it in the upload queue and i can't simply import it since i'm on another bbs
    than one of the ones i have access to locally...

    --- Mystic BBS v1.10 A59 (Linux)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX