Subj : Some easy BAJA questions?
To   : High Spirit
From : Digital Man
Date : Wed Jan 08 2014 04:52 pm

 Re: Some easy BAJA questions?
 By: High Spirit to All on Wed Jan 08 2014 10:31 am

> So I have my first Synchronet BAJA program almost complete. Along the way I
> run into a few possible issues that I need answered.
>
> Are there system variables the directory locations configured in SCFG? My
> program opens data files and I would like the files to be stored in the
> SBBS/DATA/<MYPROGRAM> folder. I am currently accomplishing this by using
> "/sbbs/data/<MYPROGRAM>" (linux path). Would the proper way be to use
> "../data/<MYPROGRAM>"? But that leads me to another question... What if the
> DATA folder is set to be somewhere else in SCFG?

Baja modules can use the "%j" command-line specifer to get the configured "data
dir" location (see http://wiki.synchro.net/config:cmdline for examples). In
this case, '%j' is the specifier for the data directory and you can put that in
a string via Baja, like so:

sprintf my_filepath "%%j%s" my_filename

(note the double-percent escaping above)

or:

set data_dir "%j"

> Is the DATA directory the best place to store files for External Programs
> or is there another directory that would be better?

A sub-directory off of data might be a good place (like data/my_module).

> Linux vs. Windows... No not a debate... when working with paths and
> files... linux uses "/" while windows uses "\". Do I need to figure out
> what OS is being used and use the proper slash or will something interally
> figure it out?

Just use a forward-slash, it'll work on both.

                                           digital man

Synchronet "Real Fact" #52:
Synchronet Blackjack was the first multi-node/multi-user game for Synchronet.
Norco, CA WX: 61.9�F, 53.0% humidity, 1 mph ESE wind, 0.00 inches rain/24hrs

---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net