• File list/scan loadable module

    From Nightfox@1:103/705 to Digital Man on Friday, February 24, 2023 19:31:37
    Hi DM,

    I started testing the file list/scan loadable module feature. One thing I noticed is that when I call bbs.list_files() or bbs.list_file_info(), the same types of parameters are passed in argv:
    argv[0]: Directory internal code
    argv[1]: 0
    argv[2]: Filespec

    In both cases (bbs.list_files() or bbs.list_file_info()), the 2nd argument is 0. Both FL_NONE and FL_INFO are defined as 0, so I'm wondering how to differentiate between the two? I'm not sure how to determine whether the user wants to just list the files with the given filespec (FL_NONE) or display extended information (FI_INFO).

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Nightfox on Friday, February 24, 2023 20:29:07
    Re: File list/scan loadable module
    By: Nightfox to Digital Man on Fri Feb 24 2023 07:31 pm

    Hi DM,

    I started testing the file list/scan loadable module feature. One thing I noticed is that when I call bbs.list_files() or bbs.list_file_info(), the same types of parameters are passed in argv:
    argv[0]: Directory internal code
    argv[1]: 0
    argv[2]: Filespec

    In both cases (bbs.list_files() or bbs.list_file_info()), the 2nd argument is 0. Both FL_NONE and FL_INFO are defined as 0, so I'm wondering how to differentiate between the two?

    You mean FI_INFO (not FL_INFO). The "FI" stands for file info, so only use those values in a fileinfo loadable module.

    For a listfiles module, 0 means FL_NONE. "FL" steads for file list. Get it?

    I'm not sure how to determine whether the
    user wants to just list the files with the given filespec (FL_NONE) or display extended information (FI_INFO).

    Are you trying to use the same script to implement both module types? If so, you'd need to pass an extra parameter (that you define) to determine whether it's a file "list" or an "info" request.
    --
    digital man (rob)

    Synchronet "Real Fact" #29:
    Rob Swindell first called BBSes (at 300bps) with an Apple II computer in 1982 Norco, CA WX: 49.6øF, 86.0% humidity, 8 mph NE wind, 0.20 inches rain/24hrs
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nightfox@1:103/705 to Digital Man on Friday, February 24, 2023 20:49:42
    Re: File list/scan loadable module
    By: Nightfox to Digital Man on Fri Feb 24 2023 07:31 pm

    Another thing I noticed - Synchronet doesn't seem to be passing the additional bool argument to indicate the user is scanning all directories. I think that would be the case for something like the following?

    bbs.scan_dirs(FL_ULTIME, true);

    With that, my script is only getting 2 command-line arguments, both of which are FL_ULTIME.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nightfox@1:103/705 to Digital Man on Friday, February 24, 2023 20:52:05
    Re: File list/scan loadable module
    By: Digital Man to Nightfox on Fri Feb 24 2023 08:29 pm

    I started testing the file list/scan loadable module feature. One
    thing I noticed is that when I call bbs.list_files() or
    bbs.list_file_info(), the same types of parameters are passed in argv:
    argv[0]: Directory internal code
    argv[1]: 0
    argv[2]: Filespec

    In both cases (bbs.list_files() or bbs.list_file_info()), the 2nd
    argument is 0. Both FL_NONE and FL_INFO are defined as 0, so I'm
    wondering how to differentiate between the two?

    You mean FI_INFO (not FL_INFO). The "FI" stands for file info, so only use those values in a fileinfo loadable module.

    For a listfiles module, 0 means FL_NONE. "FL" steads for file list. Get it?

    Yes, that was a typo.

    Are you trying to use the same script to implement both module types? If so, you'd need to pass an extra parameter (that you define) to determine whether it's a file "list" or an "info" request.

    Ah, I see. I was thinking the same script could do both, but for now I might just implement my file lister for the FL_ options.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nightfox@1:103/705 to Digital Man on Friday, February 24, 2023 21:03:42
    Re: File list/scan loadable module
    By: Nightfox to Digital Man on Fri Feb 24 2023 08:49 pm

    Another thing I noticed - Synchronet doesn't seem to be passing the additional bool argument to indicate the user is scanning all directories. I think that would be the case for something like the following?

    bbs.scan_dirs(FL_ULTIME, true);

    Maybe I was wrong about what I was seeing. In that case, it seems the first argument is the bool (0/1) and the 2nd argument is one of the FL_ values - Is that correct?

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Nightfox on Friday, February 24, 2023 21:12:59
    Re: File list/scan loadable module
    By: Nightfox to Digital Man on Fri Feb 24 2023 09:03 pm

    Re: File list/scan loadable module
    By: Nightfox to Digital Man on Fri Feb 24 2023 08:49 pm

    Another thing I noticed - Synchronet doesn't seem to be passing the additional bool argument to indicate the user is scanning all directories. I think that would be the case for something like the following?

    bbs.scan_dirs(FL_ULTIME, true);

    Maybe I was wrong about what I was seeing. In that case, it seems the first argument is the bool (0/1) and the 2nd argument is one of the FL_ values - Is that correct?

    Correct. Same pattern as the scan subs loadable module.
    --
    digital man (rob)

    Synchronet/BBS Terminology Definition #27:
    DTE = Data Terminal Equipment
    Norco, CA WX: 50.0øF, 84.0% humidity, 5 mph N wind, 0.19 inches rain/24hrs
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Nightfox on Friday, February 24, 2023 21:22:30
    Re: File list/scan loadable module
    By: Nightfox to Digital Man on Fri Feb 24 2023 08:52 pm

    Re: File list/scan loadable module
    By: Digital Man to Nightfox on Fri Feb 24 2023 08:29 pm

    I started testing the file list/scan loadable module feature. One
    thing I noticed is that when I call bbs.list_files() or
    bbs.list_file_info(), the same types of parameters are passed in argv:
    argv[0]: Directory internal code
    argv[1]: 0
    argv[2]: Filespec

    In both cases (bbs.list_files() or bbs.list_file_info()), the 2nd
    argument is 0. Both FL_NONE and FL_INFO are defined as 0, so I'm
    wondering how to differentiate between the two?

    You mean FI_INFO (not FL_INFO). The "FI" stands for file info, so only use those values in a fileinfo loadable module.

    For a listfiles module, 0 means FL_NONE. "FL" steads for file list. Get it?

    Yes, that was a typo.

    Are you trying to use the same script to implement both module types? If so, you'd need to pass an extra parameter (that you define) to determine whether it's a file "list" or an "info" request.

    Ah, I see. I was thinking the same script could do both, but for now I might just implement my file lister for the FL_ options.

    The same script *could* do both (though that's probably not the tack I'd take), but if you did, you'd need to pass an extra parameter, like I said, to indicate in what context the script was being called.
    --
    digital man (rob)

    Breaking Bad quote #6:
    My Name is ASAC Schrader - and you can go fuck yourself. - Hank Schrader
    Norco, CA WX: 49.9øF, 84.0% humidity, 0 mph ENE wind, 0.19 inches rain/24hrs --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)