-
Some easy BAJA questions?
From
High Spirit@VERT/DCBBS to
All on Wed Jan 8 10:31:46 2014
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?ããIs the DATA directory the best place to store files for External Programs or is ãthere another directory that would be better?ãã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?ããThanks for your help. :)ãã-- High Spiritãã---ã þ Synchronet þ Digital Creation BBS -- bbs.digitalcreationbbs.comã
-
From
Access Denied@VERT/PHARCYDE to
High Spirit on Wed Jan 8 12:48:48 2014
Hello High,ããOn 08 Jan 14 10:31, High Spirit wrote to All:ãã HS> So I have my first Synchronet BAJA program almost complete. Along theã HS> way I run into a few possible issues that I need answered.ãã HS> Are there system variables the directory locations configured in SCFG?ã HS> My program opens data files and I would like the files to be stored inã HS> the SBBS/DATA/<MYPROGRAM> folder. I am currently accomplishing this byã HS> using "/sbbs/data/<MYPROGRAM>" (linux path). Would the proper way beã HS> to use "../data/<MYPROGRAM>"? But that leads me to another question...ã HS> What if the DATA folder is set to be somewhere else in SCFG?ããThat shouldn't matter. Synchronet by default starts in the exec directory, I ãbelieve. So you have the ability to use "../" to go back one directory, and ãcontinue from there. Using exact paths is not a problem, though.ãã HS> Is the DATA directory the best place to store files for Externalã HS> Programs or is there another directory that would be better?ããNo. External programs are usually stored in the /sbbs/xtrn directory.ãã HS> Linux vs. Windows... No not a debate... when working with paths andã HS> files... linux uses "/" while windows uses "\". Do I need to figureã HS> out what OS is being used and use the proper slash or will somethingã HS> interally figure it out?ããI believe it corrects it for you depending on the OS you run. Though, whatever ãOS you're running, you might want to at least try to use the proper way ãaccording to your OS.ããBut if you're just asking in regards to any current default configurations, ãand hoping you don't have to go through the whole thing and change all the ãdefault settings, then no, you shouldn't have to.ããRegards,ãNickãã--- GoldED+/LNX 1.1.5-b20130910ã * Origin: Dark Sorrow | darksorrow.us (723:1/701)ã þ Synchronet þ thePharcyde_
telnet://bbs.pharcyde.org (Wisconsin)ã
-
From
Digital Man@VERT to
High Spirit on Wed Jan 8 16:52:21 2014
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 þ [vert/cvs/bbs].synchro.netã
-
From
Mro@VERT/BBSESINF to
High Spirit on Wed Jan 8 22:20:07 2014
Re: Some easy BAJA questions?ã By: High Spirit to All on Wed Jan 08 2014 10:31 amãã > "/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?ãã > Is the DATA directory the best place to store files for External Programsã > or is there another directory that would be better?ãããwhat i would suggest you do is keep all the files from your mod out of everyoneãelse's files. i've been guilty of violating that rule with my personal mods,ãbut i really think that is what everyone should do. it stops a mess fromãoccuring and it makes updating easy.ããyou can use the percent code variables and then go back ../to/your/dirãin the past, i had to use double slashes, but i'm not sure if that issue hasãbeen corrected. regardling linux, i think you can just use forward slashes forãboth win and linux baja scripts. but it's been so long, i'm not sure. eitherãway, you can get a text replacement program and switch the slashes and make 2ãversions of your mod.ããin the past a lof people put their mods in sbbs/data/DIRNAME. for example, oneãguy had one called data/bajamods/modname for each addon he created.ããif you want me to take a look at your script, get me on irc on irc.bbses.infoã[dont visit for 1 minute and leave, please]. i used to be great with baja butãnow i'm a bit rusty. it comes back to me after playing around with it a bit.ã---ã þ Synchronet þ ::: BBSES.info - free BBS services :::ã
-
From
Mro@VERT/BBSESINF to
Access Denied on Wed Jan 8 22:22:42 2014
Re: Some easy BAJA questions?ã By: Access Denied to High Spirit on Wed Jan 08 2014 12:48 pmãã > That shouldn't matter. Synchronet by default starts in the exec directory,ã > I believe. So you have the ability to use "../" to go back one directory,ã > and continue from there. Using exact paths is not a problem, though.ããããi think it does, or maybe it's configurable in scfg. ããregardless he will be one ãsub dir into sbbs/ so ../ will get him out to the sbbs dirãsbbs/xtrn is a great location for addons. some of my own have dirs off ofãsbbs, and i keep the games i wrote in sbbs/xtrn/ã---ã þ Synchronet þ ::: BBSES.info - free BBS services :::ã
-
From
High Spirit@VERT/DCBBS to
Digital Man on Thu Jan 9 10:45:35 2014
Re: Some easy BAJA questions?ã By: Digital Man to High Spirit on Wed Jan 08 2014 04:52 pmãã > 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"ããNot sure how I missed that page... will bookmark it for future reference... ãthank you DM.ãã-- High Spiritãã---ã þ Synchronet þ Digital Creation BBS -- bbs.digitalcreationbbs.comã
-
From
High Spirit@VERT/DCBBS to
Mro on Thu Jan 9 10:53:32 2014
Re: Some easy BAJA questions?ã By: Mro to High Spirit on Wed Jan 08 2014 10:20 pmãã > what i would suggest you do is keep all the files from your mod out ofã > everyone else's files. i've been guilty of violating that rule with myã > personal mods, but i really think that is what everyone should do. itã > stops a mess from occuring and it makes updating easy.ããYeah, that was the idea. Don't want to interfere with anything else that has ãbeen written.ãã > if you want me to take a look at your script, get me on irc onã > irc.bbses.info [dont visit for 1 minute and leave, please]. i used to beã > great with baja but now i'm a bit rusty. it comes back to me after playingã > around with it a bit.ããOnce I feel it is ready for others to view, I will for sure. I go over my code ãonce and a while and find a better way to do something and re-write that ãportion of the code. The script is pretty basic, but it got me starting into ãBAJA.ãã-- High Spiritãã---ã þ Synchronet þ Digital Creation BBS -- bbs.digitalcreationbbs.comã
-
From
Nightfox@VERT/DIGDIST to
High Spirit on Thu Jan 9 19:42:51 2014
Re: Some easy BAJA questions?ã By: High Spirit to All on Wed Jan 08 2014 10:31:46ãã HS> Linux vs. Windows... No not a debate... when working with paths andã HS> files... linux uses "/" while windows uses "\". Do I need to figure outã HS> what OS is being used and use the proper slash or will somethingã HS> interally figure it out?ããI think Synchronet lets you use "/" and Synchronet takes care of the real pathãseparator depending on what OS you use - so "/" should work on both Windows andãLinux. That simplifies things a bit.ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
-
From
Mro@VERT/BBSESINF to
High Spirit on Thu Jan 9 22:21:20 2014
Re: Some easy BAJA questions?ã By: High Spirit to Mro on Thu Jan 09 2014 10:53 amãã > Once I feel it is ready for others to view, I will for sure. I go over myã > code once and a while and find a better way to do something and re-writeã > that portion of the code. The script is pretty basic, but it got meã > starting into BAJA.ãããthe good thing about baja is there's about 2-3 ways to do something.ãyou wont really hit a wall until you get into some really advanced stuff.ãsmeg was a great baja programmer and very creative. he's a good one to learnãfrom. one of his greatest attributes was his creativity.ã---ã þ Synchronet þ ::: BBSES.info - free BBS services :::ã