Mumpster
http://mumpster.org/

More MUMPS V1 utility
http://mumpster.org/viewtopic.php?f=13&t=398
Page 4 of 8

Author:  cais28 [ Sat Sep 03, 2011 3:43 am ]
Post subject:  Re: More MUMPS V1 utility

Hi

www.cais-system.com/MUMPS/MV1_SysTray_Ubuntu/2_0_beta/
In the MV1 Studio 1.0 (some bug) fixed .
In this release : Explorer (browsing or Delete Globals/Routines , Make New Routine , Edit Routine)
In MV1 Studio window-resize is ENABLE ....

Author:  sgroisy [ Mon Sep 12, 2011 3:45 am ]
Post subject:  Re: More MUMPS V1 utility

Hi Ray

The doyen of the true Mumps world - great to see you mentoring the brotherhood .... Sgroisy - a total crap Mumps programmer myself ...

Author:  cais28 [ Fri Oct 21, 2011 8:28 am ]
Post subject:  Re: More MUMPS V1 utility

Hi Everybody

I have more question :
in MV1 file EOF = ($KEY=$c(255)) this is correct ?
In binary file (ex.:journal file) this will be work ?

Ex.: This Utility working fine with *.TXT , *.HTML , *.JPG ...
;=== General File Read Process
W !,"MUMPS V1 File reader Utility",!
RF R "File (?=Dir): ",FN G:FN="" EX
I FN="?" D
.K DIR S DIR(1)=$&%DIRECTORY("*") W ! S $E(BLL,80)=" "
.F I=2:1 Q:DIR(I-1)="" S DIR(I)=$&%DIRECTORY("")
.N $ES S I="" F S I=$O(DIR(I)) Q:I="" W $E($G(DIR(I))_BLL,1,20)_"| " W:'(I#3) !
W ! G:FN="?" RF
;--- Read File & Save ^MFILE(seq)=text/data
K ^MFILE I '$&%FILE(FN,"EXISTS") W " ...FILE NOT EXIST !",! G RF
;Use Standard TERMINATOR=$C(13,10) & EOF:$KEY=255
C 1 O 1:(FN:"R") S SEQ=1,K=0 F Q:K=255 D
.U 1 R LN S K=$A($K)

And , if USE parameter "TERMINATOR=" *empty* , how much data read from file to local variable ? Max.length is 32k ?
. ;U 0 w !,"|K:="_K_"|LN:="_LN_"|" R A
.S ^MFILE(SEQ)=LN,SEQ=SEQ+1
C 1 U 0 W !,"File save to ^MFILE global done.",!
EX ;
G ^%M

Author:  raynewman [ Fri Oct 21, 2011 2:17 pm ]
Post subject:  Re: More MUMPS V1 utility

($K=$C(255)) or ($A($K)=255) is correct.
If terminator is null, 32767 bytes should be read. Limit this with READ VAR#LIMIT.
For a binary file, I usually used F U IN Q:$A($K)=255 R *V U OUT W *V
As an example, see JOURNLST in MGR on a standard MV1 distribution.

Ray Newman

Author:  cais28 [ Sat Oct 22, 2011 1:37 pm ]
Post subject:  Re: More MUMPS V1 utility

Thanx for help Ray

In the past week finished the introduction of new Clinical software in MV1 & Gambas .
MV1 working perfect , and Gambas application is same (all data manipulation and algorithm writed in MUMPS , Gambas use only graphic interaction with user).
(We use always 32k block size in database , because this practical for "Patient text records" )

The MV1 is a better distribution of Standard MUMPS ! We use MV1 for our work exclusively in the future ...
The new MV1 Studio use some client , for testing any MUMPS routine migrate from other M/Cache . It would be necessary to make better Global Editor one than it InterSystems-CacheGlobalViewer :)

I hope for it now I will have time to continue the work with SysTray2 (CrossSystemJournaling and Global Editor) .
For use the remote journal file , whish solution better ? :
1. use the standard Linux/Unix file sharing for remote Journal File
(under MV1 runtime can't share the journal file to other process ?)
2. use a special TCP/IP port/session & runing on remote system a journal file reader process

Author:  raynewman [ Sat Oct 22, 2011 2:17 pm ]
Post subject:  Re: More MUMPS V1 utility

Something like option 2.
As the journal file is opened O_RDWR, another c process could also open it
O_RDWR as well. This process could then loop on the next free byte in the file
(bytes 0 - 3 are a fixed number MUMPS_MAGIC-1 and bytes 4 - 7 point at the next
free byte initially 20). Each time next free changed, fetch the record and send it via tcp.

Ray

Author:  raynewman [ Sat Oct 22, 2011 3:21 pm ]
Post subject:  Re: More MUMPS V1 utility

Error in last post - next free byte is in bytes 4 - 11 (i.e. it's an eight byte quantity).

Ray

Author:  cais28 [ Sun Oct 23, 2011 2:33 am ]
Post subject:  Re: More MUMPS V1 utility

Ray

The structure of Journal File is clear .
R MAGIC#4,OFFSET#8,TIME#8,DATA#(SIZE-8)
SIZE=$E(TIME,1,2)
and ...
UCI=$A(TIME,4),ACTION=$A(TIME,3)

What is a MAGIC NUMBER ?

Im now write/make a simple DeJournal Utility (first only localTCP, in terminal mode) , working same like as JOURNLST (reading a journal file) & Execute action to empty database (rebuild the "master" database) , + need some selection (wish global , action , date period , ....)
Any global setting to Jornal ON is easy , but general Journal function (Journaling switch ON/OFF) possible change under runtime ? or only "J 1" single user mode .
Checking the jornaling semafor , when "mumps" environment creating time ?

Author:  raynewman [ Sun Oct 23, 2011 2:54 am ]
Post subject:  Re: More MUMPS V1 utility

From mumps/include/mumps.h
#define MUMPS_MAGIC 4155766917UL // seems unique
MAGIC for the journal file is MUMPS_MAGIC-1 - if this is confusing, see 'man file'

I don't understand the problem described after 'Any global setting to Jornal ON is easy , but general Journal function '...

Ray

Author:  cais28 [ Sun Oct 23, 2011 3:01 am ]
Post subject:  Re: More MUMPS V1 utility

OK

When MV1 is runing (without jornaling , $^SYSTEM("VOL",1,"JOURNAL_REQUEST")=0 ) , possible change *without restarting MV1* this jornal status (switch ON) ?

Josef

Page 4 of 8 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/