Is there a limit to how much can be read in one 'chunk' via Receive
Packet?
(form : Receive Packet(Document_reference;Variable;number_of_Characters)
I am trying to test some code which is attempting to import text from a
file.
In this case the file is known to be larger then 4D can handle as one
text/blob. File size is 3.6gb.
So.. I am trying to read into text array elements. This may end up
being a futile task, but I want to try :/
I tried Receive Pack with a character count of 1.6gb (maxlong -
450,000,000) - 4D Chokes, regardless of memory given to the process --
somewhat expected. So, smaller blocks of text at one time.
Shift down the size of the block read by a factor of 10 (169meg). 4D
now will read in the block, yea!
but Receive Packet fails after the 4th iteration on the loop. No error
code is generated (there is an error handler running) 4 * 169mb #
3.6gb, OK variable is simply set to 0, which terminates the repeat loop.
I almost forgot, one more complicating factor, the method doing the
work is in a component.
CODE:
ON ERR CALL("err_File_Errors")
If ($Doc_Ref#?00:00:00?)
$Max_Text_Length:=2*10^9
$File_Size:=Get document size($Doc_Ref)+Get document size($Doc_Ref;*)
If ($File_Size>$Max_Text_Length) & (Not($Filling_Array)) &
(Not(Nil($Errors)))
utl_errtxt_Add ("File size exceeds capacity of the text variable. First
2GB of data imported.")
End if
End if
$Block_Size:=Int(1.5*(10^8)) //150 megs
SET TIMEOUT(1) //insure that if there is a problem, a time out occurs
$Pole_ID:=utl_thrm_Start_Barber_Pole ("Reading Data from File...")
//load the array with text in 150meg blocks
Repeat
Case of
: ($Filling_Array)
APPEND TO ARRAY($Text_to_Fill->;"")
If ($Doc_Ref#?00:00:00?)
RECEIVE PACKET($Doc_Ref;$Text_to_Fill->{Size of
array($Text_to_Fill->)};$Block_Size)
Else
RECEIVE PACKET($Text_to_Fill->{Size of
array($Text_to_Fill->)};$Block_Size)
End if
$Exit_Loop:=(OK=0)
//code not involved removed
End case
Until ($Exit_Loop) //receive packet fails, or text var is full
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************