Jun 03, 2013; 20:15
Marc Vos
L9 question about dir
Hi,
I've been browsing the Lassodocs now for the last hour, searching for a way to do 'ls /tmp/e*' or something similar. I want a subset of a list of file names.
dir() does not accept any wildcards - Lasso9 crashes the script with 'no such file or directory' instead of returning file_currenterror when I try dir('//tmp/e*')
An unhandled failure during a web request
Error Code: 2
Error Msg: OS error: 2 No such file or directory
Error Stack:
65:22 dir.lasso
545:5 traits.lasso
71:11 query.lasso
137:9 query.lasso
80:8 query.lasso
24:1 //Library/WebServer/Documents//lp9/sometests.ls
I hoped os_process can do that, but it simply keeps returning the contents of the lasso home dir, no matter what I pass:
local(files = OS_Process('/bin/ls', array('/users')));
(#files->read)->split('\n');
#files->close;
array(JavaLibraries, LassoApps, LassoLibraries, LassoModules, SQLiteDBs, lasso9.im.fastcgi.sock, )
local(files = OS_Process('/bin/ls', array('/tmp')));
(#files->read)->split('\n');
#files->close;
array(JavaLibraries, LassoApps, LassoLibraries, LassoModules, SQLiteDBs, lasso9.im.fastcgi.sock, )
local(files = OS_Process('/bin/ls', array('/')));
(#files->read)->split('\n');
#files->close;
array(JavaLibraries, LassoApps, LassoLibraries, LassoModules, SQLiteDBs, lasso9.im.fastcgi.sock, )
local(files = OS_Process('/bin/ls', array('gobbledeegook')));
(#files->read)->split('\n');
#files->close;
array(JavaLibraries, LassoApps, LassoLibraries, LassoModules, SQLiteDBs, lasso9.im.fastcgi.sock, )
So I am left with dir('/my/dir/') and then looping through some a pile of an unknown number of files to filter out my files, also an unknown number of files.
[ L9.2.5; OS X 10.8.3 ]
Tips, anyone? Thanks in advance!
- -
Marc
#############################################################
Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jun 05, 2013; 09:50
Jonathan Guthrie
Re: L9 question about dir
Jun 06, 2013; 06:50
Jolle Carlestam
Re: L9 question about dir
Jun 06, 2013; 07:14
Jolle Carlestam
Re: L9 question about dir
Jun 06, 2013; 09:24
Marc Vos
Re: L9 question about dir