newLISP Fan Club

Forum => newLISP in the real world => Topic started by: danil on June 09, 2004, 12:00:41 AM

Title: about file permissions
Post by: danil on June 09, 2004, 12:00:41 AM
Hi, all and thanks Lutz for a great software.

I have a slightly funny behaviour of newlisp on FreeBSD - it creates files with execution flags. Is there any intention behind this or may be I'm doing something wrong?





%newlisp
newLISP v8.0.6 Copyright (c) 2004 Lutz Mueller. All rights reserved.

> (write-file "test" "test") (exit)
4%ls -l test
-rwxr-xr-x  1 danil  wheel  4  9 июн 10:50 test
Title:
Post by: Lutz on June 09, 2004, 05:50:25 AM
Welcome to the group Danil! On Linux/BSD and other Unix 'write-file' by default uses 0777 (all flags turned on) masked by the usermask which would be:



(& 0777 (~ 022)) => 493 => 0755 => -rwxr-xr-x





You could use:



(! "chmod 644 test")



or you could change the usermask on your system with the Unix command umask.



Lutz
Title:
Post by: danil on June 10, 2004, 11:31:05 PM
Thanks, Lutz

Another question - how do folks develop moderate sized programs in newLisp, what environment are you using, etc? newlisp-tk is very handy when creating small snippets (I'm used to Smalltalk, but it's definitely overkill for scripting), but I found a bit bothering to gather these pieces together (although "save context" helps a lot). What are patterns here?
Title:
Post by: Lutz on June 11, 2004, 06:27:46 AM
I use newlisp-tk rarely and only for trying out small functions etc. or when I do statistical analysis together with Gnuplot.  When I develop web scripts, which is what I mostly do with newLISP, I use a text editor with parenthesis matching (vi, JEdit etc) and the plain newlisp.exe executable.



Frequently I just log into my web site server with SSH/Telnet and use vi to develop scripts and test them directly with the browser, and with equal frequency I use newlisp-IDE to develop/try out code portions directly on the webserver via the browser. newlisp-IDE is also good for keeping/maintaining a library of code portions and have it available wherever I can find a computer with Internet connection.



Besides web stuff I have lots of other scripts running on nuevatec.com /newlisp.org: cron jobs and other server admin stuff, Bayes spam filtering etc all scripted in newlisp. My web server host runs FreeBSD.



Lutz
Title:
Post by: nigelbrown on June 11, 2004, 06:28:54 AM
I've not written 'moderate' size programs but when converting a C program to newlisp

for the pdf generating module I found Vim (see www.vim.org)  in the GUI version

good to work with . It flashes matching brackets - I found this a big help.

Nigel
Title:
Post by: danil on June 11, 2004, 07:24:13 AM
Ok (I'm using vim as all-purpose editor too).

So one should go through edit-quit-run cycle (or invoke edit from newlisp?). It seems that I simply need some practice to make less errors and to find them quickly. newlisp is so nicelly engineered that it's possible to memorize almost the whole library and it's the first lisp that don't seem allien to me :)
Title:
Post by: nigelbrown on June 12, 2004, 04:22:09 AM
Using vim I have the tk/tcl gui running, save from vim (no need to quit vim), switch to gui and push button for reload last source - if I fiddle with some defines interactively in the gui (which is what lisp is good at) I then cut and paste the improved code back into vim.



Nigel