• file listing

    From maskreet@21:1/114 to g00r00 on Mon Feb 17 10:05:48 2020
    I'm trying to just get a listing of all files in each file base. I'd provide sample code, but I've written and re-written so much stuff trying to get it
    to work that it's all a jumble at the moment. =\

    Once I know how to just get a list going, I can separate everything into its respective group/base/files for output. I'm just stuck because I'm not sure
    how to access the files and descriptions themselves.

    --- Mystic BBS v1.12 A45 2020/02/12 (Linux/64)
    * Origin: throwbackbbs.com -\- meriden, ct -\- (21:1/114)
  • From g00r00@21:1/108 to maskreet on Mon Feb 17 11:28:06 2020
    Once I know how to just get a list going, I can separate everything into its respective group/base/files for output. I'm just stuck because I'm
    not sure how to access the files and descriptions themselves.

    To list files you have to call "fl_open" and pass it the filename of the filebase you want to open. After that you call "fl_seek" to the start of the database and then you loop through it:

    # open file base

    flist = fl_open("filename")

    # if it didn't work exit

    if flist is None:
    writeln("Open failed")
    quit()

    # start at beginning of file list

    fl_seek (flist, 0, true)

    # whenever we seek to a file or ask for the next or previous file in the
    # file base, the fl_found will be set to true or false to tell us if the call
    # found a file. So we need to loop by checking fl_found:

    while fl_found(flist) and not shutdown():

    # call getfile to get the next file data into fileinfo
    # and then print the filename

    fileinfo = fl_getfile(flist)

    writeln("File: " + fileinfo["filename"])

    # calling getfile only returns the base file information not the
    # description, so if we want to get the description for the file we need
    # to call getdesc which returns the description (ANSI descriptions are
    # converted to pipe colors)

    filedesc = fl_getdesc(flist)

    # now that we have the file description, loop through it and print it out

    for line in range(1, fileinfo["lines"]):
    writeln(filedesc[line])

    # ask for next file and then let it loop to the top again

    fl_next(flist)

    # when we get here its because fl_found was false meaning there were no
    # more files found, so we close the file list

    fl_close(flist)

    [SNIP]

    To pseudocode it:

    1. Open file base
    2. Seek to start of database
    3. Do we have a file? (fl_found)
    4. If yes: Read file, print filename, ask for next file. Goto 3.
    5. close file base

    --- Mystic BBS v1.12 A45 2020/02/15 (Windows/64)
    * Origin: Sector 7 (21:1/108)
  • From maskreet@21:1/114 to g00r00 on Mon Feb 17 14:33:20 2020
    On 17 Feb 2020, g00r00 said the following...

    Once I know how to just get a list going, I can separate everything i its respective group/base/files for output. I'm just stuck because I' not sure how to access the files and descriptions themselves.

    To list files you have to call "fl_open" and pass it the filename of the filebase you want to open. After that you call "fl_seek" to the start
    of the database and then you loop through it:

    [snip all of the awesomeness]

    Thank you so much, man! I just needed to know what does what and how it works with regards to the file bases. I'm going to save a copy of this message
    right now and work on it later. Woke up sick with a massive headache. =\

    --- Mystic BBS v1.12 A45 2020/02/12 (Linux/64)
    * Origin: throwbackbbs.com -\- meriden, ct -\- (21:1/114)
  • From g00r00@21:1/108 to maskreet on Mon Feb 17 15:32:26 2020
    Thank you so much, man! I just needed to know what does what and how it works with regards to the file bases. I'm going to save a copy of this message right now and work on it later. Woke up sick with a massive headache. =\

    I hope it helps sorry to hear you're feeling bad!

    --- Mystic BBS v1.12 A45 2020/02/15 (Windows/64)
    * Origin: Sector 7 (21:1/108)