The "binary" (9B 0) data type isn't really the right type for this
structure. 9B 0 only allows numbers up to 999999999, which is smaller
than a 4-byte binary field is capable of.
Instead, use the "integer" data type (10I 0) which you'd define in
your data structure like so:
d size 45 48i 0
This will allow you to handle size values up to 2,147,483,647 bytes,
which sounds like it will work for your application.
If this still isn't large enough, you'll need to look into using the
"large file support" versions of the IFS API. The function should
be called "fstat64" or "stat64". stat64 returns the size in a field
defined as "20I 0", which should be a big enough number for almost
anyone :)
On Wed, 18 Apr 2001 rob@dekko.com wrote:
>
> I am using a bit of code I probably got from someone on this list quite
> some time ago. It reads the directories in the IFS and reports back on
> size. Evidently I've reached the limit of a 4B 0 field. The file is
> bigger than a gig. And, while yes, we should address that issue, I want to
> get the list program working. Here are some lines of code:
>
>
> DStatStruc DS 128
> d fill1 1 20
> D* Size 21 24B 0
> d size 45 48b 0
> d FileType 49 53
> d fill4 76 127
> DpStatStruc S * Inz(%Addr(StatStruc))
> ...
> c eval boxsize = size
> ...
> *
> * Get file information
> *
> c eval Dir#File = %Subst(StreamDir:1:Leny - 1)
> c + %Subst(FileNam:1:Len)
> c + X'00'
> C Eval RC = Stat(pDir#File:pStatStruc)
> ...
> c eval boxsize = size
> ...
> MCH1210 - The target for a numeric operation is too small to hold the
> result (C G D F)
> 'D'
> BOXSIZE PACKED(12,0) 000007864320.
> VALUE IN HEX '0000007864320F'X
>
> BOXSIZE must be from previous file.
>
> SIZE BIN(9,0) 078984704. '40500000'X
>
> 1 is truncated from the beginning of SIZE.
>
> How could I change 'size' without messing up the data structure?
>
>
>
>
> Rob Berendt
>
> ==================
> Remember the Cole!
>
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---