🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
2 messages
2 total messages Started by Bjoern Frantzen Mon, 27 Apr 1998 00:00
Re: slrn: saving articles
#40455
Author: Bjoern Frantzen
Date: Mon, 27 Apr 1998 00:00
25 lines
1574 bytes
Vikas Agnihotri <vikasa@att.com> wrote:
>How do I save articles to a mbox format file? The save-article function
>prompts me for the file name with the value of save_directory suffixed with
>the name of the current group. I dont want the current group name. I want
>all articles to be saved to *ONE* file similar to the save_posts file.
>
>Suppose I want to save to the file ~/Usenet/Saved, I would still like to be
>prompted with the above as the default file-name which I can change. Right
>now, it prompts me with ~/News/news.software.readers (save_directory=News,
>of course).
>
>README.macros says that the intrinsic function save_article_to_file
>creates a new file every time, so this wont do.

Take a look at Jan Hlavacek's file.sl, posted here a week or two ago, or
form his website at
<URL:http://www.math.ohio-state.edu/~lahvak/software/slrn/save.sl.txt>

I think this does pretty much what you want.

-- 
        Bjoern Frantzen      - bjoff@bgnett.no

Re: slrn: saving articles
#40442
Author: Jan Hlavacek
Date: Mon, 27 Apr 1998 00:00
89 lines
3577 bytes
On Mon, 27 Apr 1998 19:06:32 +0200, Bjoern Frantzen <bjoff@bgnett.no>
wrote:
> Vikas Agnihotri <vikasa@att.com> wrote:
> >How do I save articles to a mbox format file? The save-article function
> >prompts me for the file name with the value of save_directory suffixed with
> >the name of the current group. I dont want the current group name. I want
> >all articles to be saved to *ONE* file similar to the save_posts file.
> >
> >Suppose I want to save to the file ~/Usenet/Saved, I would still like to be
> >prompted with the above as the default file-name which I can change. Right
> >now, it prompts me with ~/News/news.software.readers (save_directory=News,
> >of course).
> >
> >README.macros says that the intrinsic function save_article_to_file
> >creates a new file every time, so this wont do.
> 
> Take a look at Jan Hlavacek's file.sl, posted here a week or two ago, or
> form his website at
> <URL:http://www.math.ohio-state.edu/~lahvak/software/slrn/save.sl.txt>

Note that this is an old version.  Newer,  much improved version,  can
be obtained from
http://www.math.ohio-state.edu/%7Elahvak/slang/files/slrn/filename.sl

It works with S-Lang v1+,  and have more sophisticated way of specifying
the names of folders.  However,  it is probably overkill for the thing
Vikas asked.  Something like this should be enough:


define append_article_save (file)
{
   % Saves the current article to the named file, appending if the file
   % exists.

   if (is_group_mode) return ();        % this only works in article mode

   set_input_string (file);             % put filename in the response stack
   call ("save");                       % save article (into file)
}

define filename_create_home_path ()
{
   variable path = getenv ("HOME");
   variable fn;
   _stk_reverse (_NARGS);
   loop (_NARGS)
   {
      fn = ();
      path += ("/" + fn);
   }
   path;
}

define filename_complete_filename (file)
{
   % Append the name of the file to ${HOME}/News/
   % unless it starts with ~ or /
   
   if (file[0] == '~') 
      return (filename_create_home_path (substr (file, 2, -1)));
   if (file[0] == '/') return (file);
   
   filename_create_home_path (get_variable_value("save_directory"),
                          "folders", file);
}

define my_save ()
{
   variable file = read_mini ("Append to folder", "", "~/Usenet/Saved");
   
   append_article_save (filename_complete_filename (file));
}


> 
> I think this does pretty much what you want.
> 
> -- 
>         Bjoern Frantzen      - bjoff@bgnett.no


-- 
Jan Hlav\'{a}\v{c}ek <lahvak@math.mps.ohio-state.edu>  (BCC's will bounce)
home page: http://www.math.ohio-state.edu/~lahvak/
slrn page: http://www.math.ohio-state.edu/~lahvak/software/slrn.html
slrn documentation: http://www.math.ohio-state.edu/~lahvak/software/slrn/

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