- Subject: Re: Filelist mode on VMS
- From: "John E. Davis" <davis@xxxxxxxxxxxxx>
- Date: Mon, 13 Mar 2006 02:22:35 -0500
Terrence Branscombe <tlbranscombe@xxxxxxx> wrote:
>Thanks, John. That seems to have taken me one step closer. Now, when I
>start JED and specify a file, the message "listdir is undefined",
It is another example of a function that was not implemented for VMS.
This function should be defined in src/slposdir.c in the slang source
code. If you provide me with a working version of listdir, then I
will add it to a future slang release. I suspect that something like
lib$find_file / lib$find_file_end will be required. In recent years,
it appears that the VMS C run time library has adopted a number of POSIX
functions, so you may be able to reuse the Unix code in slposdir.c
(opendir/readdir/closedir).
In the meantime, you might play with something like:
define listdir (dir)
{
variable tmp = "SYS$LOGIN:listdir.tmp";
variable cmd = sprintf ("dir/output=%s %s", tmp, dir);
() = system (cmd);
variable list = fgetslines (fopen(tmp,"r"));
list = array_map (String_Type, &strtrim, list);
() = remove (tmp);
return list;
}
I probably have the output qualifier all wrong, and you may require
addition qualifier to the "dir" command to get single column output.
Hopefully the idea is clear.
Thanks,
--John
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2006 date index]
[2006 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]