๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
7 messages
7 total messages Started by Arjan Drieman Tue, 04 Jul 2000 00:00
[slrn/slang] Questions :-)
#62973
Author: Arjan Drieman
Date: Tue, 04 Jul 2000 00:00
31 lines
1819 bytes
I'm a few answers away from having a perfect slrn/slang script :-)

How can I retreive the current system date?  I'd like to have it in
different formats, like yyyy-mm-dd and dd-mm-yyyy.  (These are quite
unusual, I know, but the first is nice to use in filenames and the
latter is standard dutch notation)  If the formats aren't possible,
I can fool around with substr and strcat... if I'd only know how to
get a date string :)


Is there any way I can refer to the user's homedirectory?  ~/
doesn't work, should I just grab it from $HOME?


Is there any way to delete a file in slang?  Somehow

        system("rm -f " + filename);

doesn't really cut it for me ;-)  I mean, it works, but I think it's 
butt ugly.  I'd expect something like unlink() but I couldn't find it.


Also, is there a way to have slrn reload its scripts?  Quitting and
restarting slrn is getting... kinda old.  No biggie though.



Thanks for the aid in my quest for a perfect script,
Arjan
Re: [slrn/slang] Questions :-)
#62988
Author: Arjan Drieman
Date: Tue, 04 Jul 2000 00:00
18 lines
1479 bytes
On 04 Jul 2000 18:26:56 GMT, John E. Davis
    <da...@space.mit.edu> wrote:


> USAGE
>   Integer_Type remove (String_Type file)

>[Obtained from file /nfs/wiwaxia/h1/davis/src/jed/doc/txt/slangfun.txt]

Ah!  It seems that the information at www.s-lang.org is quite outdated
and incomplete compared to
http://space.mit.edu/%7Edavis/doc/slang/doc/html/slangfun.html


Thanks a lot for your help, John.
Arjan
Re: [slrn/slang] Questions :-)
#62996
Author: da... John E. Davis
Date: Tue, 04 Jul 2000 00:00
25 lines
1453 bytes
On Tue, 4 Jul 2000 18:43:52 +0100, Klaus Alexander Seistrup <k...@magnetic-ink.dk>
wrote:
>>    S-Lang Error: Undefined Name: delete_file is undefined
>
>Oh, I've used this function for "ages" -- perhaps it's a jed intrinsic
>rather than a slang function?

remove

 SYNOPSIS
   Delete a file

 USAGE
   Integer_Type remove (String_Type file)

 DESCRIPTION
   The `remove' function deletes a file.  It returns 0 upon
   success, or -1 upon error and sets `errno' accordingly.

 SEE ALSO
   rename, rmdir
[Obtained from file /nfs/wiwaxia/h1/davis/src/jed/doc/txt/slangfun.txt]
-----------------------------------
Re: [slrn/slang] Questions :-)
#62999
Author: k... Klaus Alexander Seistrup
Date: Tue, 04 Jul 2000 00:00
14 lines
1490 bytes
Arjan Drieman wrote:

> Is there any way to delete a file in slang?

delete_file() is your friend.


  // Klaus

-- 
ยทยทยท[ Magnetic Ink ]ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท ><> ยทยทยท
ยทยทยท[ http://www.magnetic-ink.dk/ ]ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
Re: [slrn/slang] Questions :-)
#63002
Author: k... Klaus Alexander Seistrup
Date: Tue, 04 Jul 2000 00:00
19 lines
1735 bytes
Arjan D wrote:

>> delete_file() is your friend.
> 
> Eh?  That gives me this error:
> 
>    S-Lang Error: Undefined Name: delete_file is undefined

Oh, I've used this function for "ages" -- perhaps it's a jed intrinsic
rather than a slang function?


  // Klaus

-- 
ยทยทยท[ Magnetic Ink ]ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท ><> ยทยทยท
ยทยทยท[ http://www.magnetic-ink.dk/ ]ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
Re: [slrn/slang] Questions :-)
#63003
Author: da... John E. Davis
Date: Tue, 04 Jul 2000 00:00
36 lines
1737 bytes
On 4 Jul 2000 08:19:16 GMT, Arjan Drieman <qhpxvr@abqr0911.n2000.ay.invalid>
wrote:
>How can I retreive the current system date?  I'd like to have it in
>different formats, like yyyy-mm-dd and dd-mm-yyyy.  (These are quite

For this you want to use the `localtime' function together with
`sprintf'.  For more information, see
http://space.mit.edu/%7Edavis/doc/slang/doc/html/slangfun.html.

>Is there any way I can refer to the user's homedirectory?  ~/
>doesn't work, should I just grab it from $HOME?

   You might try using the slrn `make_home_filename' function.

>Also, is there a way to have slrn reload its scripts?  Quitting and
>restarting slrn is getting... kinda old.  No biggie though.

   Use `evalfile'.  To this end, you may want to use something like:

#v+
define execute_slang () 
{
   variable str;
   
   str = read_mini ("S-Lang",  "", "");
   !if (strlen (str))
     return;
   
   eval (str);
}

definekey ("execute_slang", "^Kd", "group");
definekey ("execute_slang", "^Kd", "article");
#v-
Re: [slrn/slang] Questions :-)
#63004
Author: Arjan Drieman
Date: Tue, 04 Jul 2000 00:00
15 lines
1212 bytes
On Tue, 4 Jul 2000 13:09:21 +0100, Klaus Alexander Seistrup
    <k...@magnetic-ink.dk> wrote:

>> Is there any way to delete a file in slang?
>
>delete_file() is your friend.

Eh?  That gives me this error:

	S-Lang Error: Undefined Name: delete_file is undefined


Arjan
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads