Re: Directory and file functions?

2025-01-05 Thread Alexander Burger
On Sun, Jan 05, 2025 at 01:58:45PM -0700, Lloyd R. prentice wrote:
>I’m sorry, Alex, but I’m not well enough acquainted with PicoLisp yet
> to understand your response. Are there docs on the web to help me
> understand?

OK, I see. When I wrote

> > There is 'info', 'dir', 'cd', 'chdir', 'dirname', 'basename' and

I just listed some existing file functions. You can take a look at them
with e.g.

   : (doc 'info)

or (perhaps later)

   : (vi 'info)

and experiment with them in the REPL.


I mentioned the 'snapshot' function in @lib/too.l because it does all
kinds of file operations. It creates incremental backups of a directory
tree by recursively making hard links of unmodified files, copies of
modified files, and selectively removing older backups.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Question: How to get input value and not echo it to display in vip?

2025-01-05 Thread Lindsay Lawrence
Thanks Alex! That was a nice cue.

In my viprc I've ended up with the code below.

I can now define one or more named keys and use them to encrypt/decrypt
buffers in a given session without showing the key

Regards,
Lindsay

(setq *EncKeys '(("yek" . "key")))

(cmd "yek" (L Lst Cnt) # Set named encryption key
   (let (P1 NIL P2 NIL
 GetPwd '(() (pack (make
  (use C
 (until (sub? (setq C (getch)) "\r\n")
(link C)) ) ) ) )
 )
  (when L
 (prCmd (make (link (chop (pack "Setting encryption key for [" L
"]")
 (prCmd (make (link (chop "Enter Password:"
 (setq P1 (GetPwd))
 (prCmd (make (link (chop "Confirm Password:"
 (setq P2 (GetPwd))
 (ifn (= P1 P2)
(prCmd (list (chop "Encryption key NOT set; Password
mismatch")))
(if (assoc L *EncKeys)
   (con @ P1)
   (push '*EncKeys (cons L P1))

   )
(prCmd (list (chop "Encryption key set")))
 ) ) ) )

(cmd "enc" (L Lst Cnt) # Encrypt buffer using named key
   (when (sys "YEK" (cdr (assoc L *EncKeys)) )
 ...

(cmd "dec" (L Lst Cnt) # Encrypt buffer using named key
   (when (sys "YEK" (cdr (assoc L *EncKeys)) )
...


Re: Directory and file functions?

2025-01-05 Thread Anastasios Drakopoulos
(call 'ls '-al)

Στις Κυρ, 5 Ιαν 2025, 19:10 ο χρήστης Lloyd R. prentice <
picolisp@software-lab.de> έγραψε:

> Hello,
>
> I’m considering PicoLisp for a web app I have in mind. The app would run
> on Linux and depend heavily on directory/file navigation. But so far,
> rummaging through the docs, I fail to find basic directory/file navigation
> functions such as provided by, say, Bash.
>
> Can some kind soul please point the way?
>
> Many thanks,
>
> LRP
>
> Sent from my iPad
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subjectUnsubscribe
>


Re: Directory and file functions?

2025-01-05 Thread Lloyd R. prentice
I’m sorry, Alex, but I’m not well enough acquainted with PicoLisp yet to 
understand your response. Are there docs on the web to help me understand?

I’ve written an extensive command line app to help manage my self-publishing 
business. It simulates a large publishing company— serves as a memory palace to 
help organize data and book assets and the 
research/compose/design/typeset/marketing book publishing cycle. Now I’d like 
to bring it to the web. I co-wrote a book on the Nitrogen Erlang web 
framework—could use that. But I’d like to learn something new. My thought is to 
work through Mia’s wonderful web programming tutorials and flesh out my project 
as I go. But I’m starting with no Lisp experience and have stumbled over the 
simple problem of directory navigation. 

In addition to directory navigation I’ll need to bring up web pages for 
research, call VIM for editing, invoke LaTeX compile function, and call evince 
to reviiew PDFs. The PicoLisp db functions look promising for the data I need 
to manage.

With any degree of success, I’d like to create a number of book promo sites 
and, perhaps, even a simple on-line bookstore.

Ambitious, yes, but coming from a long-ago Forth background, I’m much attracted 
to PicoLisp’s minimalist philosophy.

Thanks,

LRP
 
Sent from my iPad

> On Jan 5, 2025, at 10:56 AM, Alexander Burger  
> wrote:
> Hi Lloyd,
> 
>> I’m considering PicoLisp for a web app I have in mind. The app would
>> run on Linux and depend heavily on directory/file navigation. But so
>> far, rummaging through the docs, I fail to find basic directory/file
>> navigation functions such as provided by, say, Bash.
> 
> There is 'info', 'dir', 'cd', 'chdir', 'dirname', 'basename' and
> probably more. Also, you can call any C function like
> 
>   (%@ "link" 'I Old New)
>   (%@ "unlink" 'I File)
>   (%@ "rename" 'I Src Dst)
> 
> and so on.
> 
> If you'd like to look at some practical examples, there is
> 
>   'docs' in @lib/debug.l
>   'snapshot' in @lib/too.l
> 
> And of course @lib/vip.l which naturally does a lot of file operations.
> 
> ☺/ A!ex
> 
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Directory and file functions?

2025-01-05 Thread Lloyd R. prentice
Hello,

I’m considering PicoLisp for a web app I have in mind. The app would run on 
Linux and depend heavily on directory/file navigation. But so far, rummaging 
through the docs, I fail to find basic directory/file navigation functions such 
as provided by, say, Bash.

Can some kind soul please point the way?

Many thanks,

LRP

Sent from my iPad

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Directory and file functions?

2025-01-05 Thread picolisp

Hi Lloyd,

Check out: cd , chdir 
, dir 
 and info 



Have fun,
- beneroth

On 05.01.25 18:00, Lloyd R. prentice wrote:

Hello,

I’m considering PicoLisp for a web app I have in mind. The app would run on 
Linux and depend heavily on directory/file navigation. But so far, rummaging 
through the docs, I fail to find basic directory/file navigation functions such 
as provided by, say, Bash.

Can some kind soul please point the way?

Many thanks,

LRP

Sent from my iPad


Re: Directory and file functions?

2025-01-05 Thread Alexander Burger
Hi Lloyd,

> I’m considering PicoLisp for a web app I have in mind. The app would
> run on Linux and depend heavily on directory/file navigation. But so
> far, rummaging through the docs, I fail to find basic directory/file
> navigation functions such as provided by, say, Bash.

There is 'info', 'dir', 'cd', 'chdir', 'dirname', 'basename' and
probably more. Also, you can call any C function like

   (%@ "link" 'I Old New)
   (%@ "unlink" 'I File)
   (%@ "rename" 'I Src Dst)

and so on.

If you'd like to look at some practical examples, there is

   'docs' in @lib/debug.l
   'snapshot' in @lib/too.l

And of course @lib/vip.l which naturally does a lot of file operations.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe