Page 1 of 1

about file permissions

Posted: Wed Jun 09, 2004 7:00 am
by danil
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?

Code: Select all

%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

Posted: Wed Jun 09, 2004 12:50 pm
by Lutz
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

Posted: Fri Jun 11, 2004 6:31 am
by danil
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?

Posted: Fri Jun 11, 2004 1:27 pm
by Lutz
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

Posted: Fri Jun 11, 2004 1:28 pm
by nigelbrown
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

Posted: Fri Jun 11, 2004 2:24 pm
by danil
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 :)

Posted: Sat Jun 12, 2004 11:22 am
by nigelbrown
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