The code that was failing on the 687.6 MB file with an out of memory error 
follows.  In order to use the Generate digest command on a file, you have to 
convert the file to a BLOB first.  If I would have written it, I would have 
just read in the file directly and computing the checksum as it streamed in, 
but for some reason the method’s author chose to allow only BLOB or Text as 
input.

C_POINTER($ptr_pathFilename;$1)
$ptr_pathFilename:=$1

C_BLOB($blobbedDocument)
DOCUMENT TO BLOB($ptr_pathFilename->;$blobbedDocument)

$0:=Generate digest($blobbedDocument;MD5 digest)

David Belote
Colorado Springs

On 10/19/16, 9:49 AM, "4D_Tech on behalf of Timothy Penner" 
<4d_tech-boun...@lists.4d.com on behalf of tpen...@4d.com> wrote:

    The docs say that Generate Digest accepts either a BLOB or a TEXT variable:
    http://livedoc.4d.com/4Dv15-R5/help/Command/en/page1147.html
    
    The docs also say that both Blobs and Text variables are limited to 2 GB - 
here are the relevant excerpts:
    
    
    BLOB http://livedoc.4d.com/4Dv15-R5/help/Title/en/page262.html#12745 
    --------
    A BLOB field or variable is a series of bytes (from 0 to 2 GB in length) 
that you can address individually or by using the BLOB Commands. There is no 
expression of type BLOB.
    Note: In the 4D Language Reference manual, BLOB parameters in command 
descriptions are denoted as BLOB.
    
    
    String http://livedoc.4d.com/4Dv16-R2/help/Title/en/page262.html#1211073 
    --------
    String is a generic term that stands for:
    * Alphanumeric fields or variables: an Alphanumeric field may contain from 
0 to 255 characters (limit set when field is defined).
    * Text fields or variables: a Text field, variable, or expression may 
contain from 0 to 2 GB of text..
    * Any String or Text expression
    There is no difference between a string or text variable.
    You can assign a string to a text field and vice-versa; 4D does the 
conversion, truncating if necessary. You can mix string and text in an 
expression.
    Note: In the 4D Language Reference manual, both string and text parameters 
in command descriptions are denoted as String, except when marked otherwise.
    
    
    -Tim
    
    **********************************************************************
    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:4d_tech-unsubscr...@lists.4d.com
    **********************************************************************


**********************************************************************
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:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to