\ <Forthmacs$Dir>.risc_os.mailing
\ mailing  tools ... hs 24.03.95

only forth also definitions  system also  hidden also


: crlf->lf	( filename -- )
	dup read fopen
	p" <Forthmacs$Dir>.xxxx" dup make drop dup
	modify fopen
	locals| w-id dummy r-id filename |
	begin	r-id fgetc dup eof <>
	while	dup carret = if drop else w-id fputc then
	repeat  drop
	w-id fclose  r-id fclose
	filename (delete
	dummy filename (rename drop ;
	
: (fmail	( filename address -- error? )
	astring astring locals| path command address filename |
	(pwd path "copy
	p" smail < "  command "copy
	filename command "cat  p"  " command "cat
	address  command "cat
	command "shell
	path (cd drop ;

: fmail		\ filename address ( -- )
	astring astring locals| filename address |
	blword filename "copy   blword address "copy
	filename address (fmail
	abort" Couldn't mail file" ;

ifdef edit
: mail	\ address ( -- )
	blword astring astring locals| command mailfile address |
	p" <Forthmacs$Dir>.mailfile" mailfile "copy
	p" -R " command "copy  mailfile command "cat
	command edit
	abort" Couldn't edit Mail"
	mailfile address (fmail
	abort" Couldn't send mail"
        mailfile (delete ;
ifend
only forth also definitions
