• Programatic way to get file bases for CLI

    From Psi-Jack@VERT/DECKHVN2/DECKHVNT to All on Thu Jul 16 11:01:47 2015
    Is there any tool available, within Synchronet, to get a listing of file bases, and their internal-codes for the ability to use that data in a bash script?

    I'm guessing this may be possible with a jsexec call and specially designed js script itself, but I'm curious if this is already available by some means or not. If not, I do intend to write said script.

    )))[Psi-Jack -//- Decker]

    ... There's little worse than being peerless in a peer-review system.

    ---
    ■ Synchronet ■ Decker's Heaven -//- bbs.deckersheaven.com
  • From Psi-Jack@VERT/DECKHVN2/DECKHVNT to Digital Man on Fri Jul 17 00:36:21 2015
    Re: Programatic way to get file bases for CLI
    By: Digital Man to Psi-Jack on Thu Jul 16 2015 07:04 pm

    Is there any tool available, within Synchronet, to get a listing of
    file bases, and their internal-codes for the ability to use that data
    in a bash script?

    If you just want the libraries and directories, those are available in JS in the file_area object (so, using jsexec for example). http://synchro.net/docs/jsobjs.html#file_area

    If you want the filenames contained within the file area, there's the filelist utility: http://synchro.net/docs/utility_reference.html#FILELIST whose output could be used by a bash script.

    Yes. I wanted the file path and code-name for use with HTick processing, to match only what actually exists in Synchronet with those matching HTick so it could best handle importing files.

    I managed to write a simple procedure with jsexec, but I'm curious about it a little. jsexec seems to always output a lot of extra stuff, granted, to stderr, which can be filtered out with a 2>/dev/null, but it worries me that it could potentially output something it should be, which would cause issues in other areas of my work.

    My alternative, of course, is a bash associative array by internal code as the key and path as the value. Which is exactly what I'm trying to get away from. heh

    )))[Psi-Jack -//- Decker]

    ... A day without sunshine is like night.

    ---
    ■ Synchronet ■ Decker's Heaven -//- bbs.deckersheaven.com