Big files size in WinXP+ system

Big files size in WinXP+ system

Post by olegs.zirn » Thu, 17 May 2007 23:12:59



How I can determine, how big is file (if file is _really_ big?). I
whant to manage some db backups, and SysFileTree returns (sample)

07/05/16/12/48 2448708096 A---- N:\BACKUP\...
07/05/14/12/01 1865632256 A---- N:\BACKUP\...
07/05/15/07/31 2077574656 A---- N:\BACKUP\...

STREAM() command results are: 2077574656,-1846259200 and 1865632256.

!But! dir result is:

2007.05.16. 12:48 15 333 609 984 f...
2007.05.14. 12:01 14 750 534 144 f...
2007.05.15. 07:31 14 962 476 544 f...

So, looks like that SysFileTree() (same is with SysDriveInfo())
returns 32bit unsigned, but STREAM() - 32 bit signed integer.

Last OREXX (3.1.2) used... (really - absolutely same result with last
ReginaRexx, which i usially use before...)

Any ideas? (Okay, okay, i just can parse 'dir /-c' output, but... )
 
 
 

Big files size in WinXP+ system

Post by Steve Swif » Fri, 18 May 2007 16:47:40

> Any ideas? (Okay, okay, i just can parse 'dir /-c' output, but... )

Unlikely, but does "Numeric Digits 12" help?

--
Steve Swift
http://www.yqcomputer.com/
http://www.yqcomputer.com/

 
 
 

Big files size in WinXP+ system

Post by olegs.zirn » Sat, 19 May 2007 14:16:07


No. Already have "Numeric Digits 15"... So Q&D function, to avoid
this:

/
*-------------------------------------------------------------------------
** Procedure GetFileSizeWin32
** return size of file, since native REXX functions broke at 2-4Gb
** also can return free space on drive
** Parameters:
** 1. (C) filename
** 2. (C) command 'SIZE' or 'FREE'
** Returns:
** file size, as returned by 'dir /-c' command
** -1 - unknown error
** -2 - file size error
** -3 - free space error
**-------------------------------------------------------------------------
*/
GetFileSizeWin32: PROCEDURE
ARG arg1
path_name =arg(1)
w32_comm =TRANSLATE(arg(2))
ts_arg =TRANSLATE(path_name)
free_mrk ="DIR(S)"

'dir /-c 'path_name' | rxqueue'
fil_siz = -2
free_siz = -3

DO WHILE QUEUED()>0
PARSE UPPER PULL SS1
PARSE VALUE SS1 WITH ss1_0 ss1_1 ss1_2 ss1_3
IF POS(ss1_3,ts_arg)>0 THEN fil_siz = ss1_2

IF POS(free_mrk,ss1)>0 THEN free_siz = ss1_2

END

ret_val=-1

SELECT
WHEN w32_comm='SIZE'
THEN ret_val=fil_siz
WHEN w32_comm='FREE'
THEN ret_val=free_siz
OTHERWISE
ret_val = -1
END

RETURN ret_val
 
 
 

Big files size in WinXP+ system

Post by Michael Lu » Sat, 19 May 2007 20:28:52


I am puzzled at why if SysFileTree returns the correct answer, you would chose the 'dir /-c' method.

I will check into the possible bug in stream().

Thanks!

--
Michael Lueck
Lueck Data Systems
http://www.yqcomputer.com/
 
 
 

Big files size in WinXP+ system

Post by olegs.zirn » Sat, 19 May 2007 22:06:14


Hmmm... I test it two times, on two different win2003 servers... In
both cases result was the same - _invalid_ size value returned by
SysFileTree :(
 
 
 

Big files size in WinXP+ system

Post by Lee Peedi » Sat, 19 May 2007 22:19:28


Testing this on WinXP, I have been able to duplicate the problem with
files > 2GB.

SysFileTree & Dir return the same results.
stream bif & stream method return the same (incorrect) results.

/* file_sizes.rex */

call SysCls
filespec = 'c:\!rexx_trials\abigfile*.txt'

'dir' filespec
say

rv = SysFileTree(filespec,bigfiles.,'f')
do i = 1 to bigfiles.0
say bigfiles.i
end
say

rv = SysFileTree(filespec,bigfiles.,'fo')
do i = 1 to bigfiles.0
say bigfiles.i '-' stream(bigfiles.i,'c','query size')
end
say

do i = 1 to bigfiles.0
astream = .stream~new(bigfiles.i)
say bigfiles.i '-' astream~query('size')
end

Results:
Volume in drive C has no label.
Volume Serial Number is 88F0-5DEE

Directory of c:\!rexx_trials

08/14/2006 03:16 PM 9,734,400 abigfile0.txt
02/20/2007 12:43 PM 19,468,801 abigfile2.txt
02/20/2007 01:01 PM 38,937,600 abigfile4.txt
05/18/2007 08:50 AM 68,140,801 abigfile5.txt
05/18/2007 08:50 AM 136,281,601 abigfile6.txt
05/18/2007 08:51 AM 272,563,201 abigfile7.txt
05/18/2007 08:53 AM 545,126,401 abigfile8.txt
05/18/2007 08:55 AM 1,090,252,801 abigfile9.txt
05/18/2007 09:01 AM 2,180,505,601 abigfileA.txt
9 File(s) 4,361,011,207 bytes
0 Dir(s) 25,730,277,376 bytes free

8/14/06 3:16p 9734400 A---- c:\!rexx_trials\abigfile0.txt
2/20/07 12:43p 19468801 A---- c:\!rexx_trials\abigfile2.txt
2/20/07 1:01p 38937600 A---- c:\!rexx_trials\abigfile4.txt
5/18/07 8:50a 68140801 A---- c:\!rexx_trials\abigfile5.txt
5/18/07 8:50a 136281601 A---- c:\!rexx_trials\abigfile6.txt
5/18/07 8:51a 272563201 A---- c:\!rexx_trials\abigfile7.txt
5/18/07 8:53a 545126401 A---- c:\!rexx_trials\abigfile8.txt
5/18/07 8:55a 1090252801 A---- c:\!rexx_trials\abigfile9.txt
5/18/07 9:01a 2180505601 A---- c:\!rexx_trials\abigfileA.txt

c:\!rexx_trials\abigfile0.txt - 9734400
c:\!rexx_trials\abigfile2.txt - 19468801
c:\!rexx_trials\abigfile4.txt - 38937600
c:\!rexx_trials\abigfile5.txt - 68140801
c:\!rexx_trials\abigfile6.txt - 136281601
c:\!rexx_trials\abigfile7.txt - 272563201
c:\!rexx_trials\abigfile8.txt - 545126401
c:\!rexx_trials\abigfile9.txt - 1090252801
c:\!rexx_trials\abigfileA.txt - -2114461695

c:\!rexx_trials\abigfile0.txt - 9734400
c:\!rexx_trials\abigfile2.txt - 19468801
c:\!rexx_trials\abigfile4.txt - 38937600
c:\!rexx_trials\abigfile5.txt - 68140801
c:\!rexx_trials\abigfile6.txt - 136281601
c:\!rexx_trials\abigfile7.txt - 272563201
c:\!rexx_trials\abigfile8.txt - 545126401
c:\!rexx_trials\abigfile9.txt - 1090252801
c:\!rexx_trials\abigfileA.txt - -2114461695

Michael and I have made the ooRexx Development Team aware of this.
Hopefully we'll have an answer soon.

Lee
 
 
 

Big files size in WinXP+ system

Post by Sahanand » Sun, 20 May 2007 00:23:21

Lee,

Is the File partition NTFS or FAT32. Fat32 can be strange with large
files.

Jon
 
 
 

Big files size in WinXP+ system

Post by Lee Peedi » Sun, 20 May 2007 01:15:07

On 18 May 2007 08:23:21 -0700, Sahananda < XXXX@XXXXX.COM >



FileSystem is NTFS - Rick has confirmed the problem with this
statement:
"There are general problems in stream with files larger than 2Gb that
are not easily fixed in the current code base. The stream code has
been significantly redone in the 4.0 code base to resolve these
issues."

Lee
 
 
 

Big files size in WinXP+ system

Post by imc » Sun, 20 May 2007 01:35:01

In a previous episode of comp.lang.rexx, Sahananda was heard to say:

FAT32 has a hard limit of 4GB on file sizes, as far as I am aware.
--
---- Ian Collier : XXXX@XXXXX.COM : WWW page (including REXX section):
------ http://www.yqcomputer.com/

New to this group? Answers to frequently-asked questions can be had from
http://www.yqcomputer.com/
 
 
 

Big files size in WinXP+ system

Post by Gerard Sch » Sun, 20 May 2007 03:01:51

olegs.zirnovs wrote:
|> Steve Swift wrote:
|> Unlikely, but does "Numeric Digits 12" help?

| No. Already have "Numeric Digits 15"... So Q&D function, to avoid
| this:
|
| /
| *-------------------------------------------------------------------------
| ** Procedure GetFileSizeWin32
| ** return size of file, since native REXX functions broke at 2-4Gb
| ** also can return free space on drive
| ** Parameters:
| ** 1. (C) filename
| ** 2. (C) command 'SIZE' or 'FREE'
| ** Returns:
| ** file size, as returned by 'dir /-c' command
| ** -1 - unknown error
| ** -2 - file size error
| ** -3 - free space error
| **-------------------------------------------------------------------------
| */
| GetFileSizeWin32: PROCEDURE
| ARG arg1
| path_name =arg(1)
| w32_comm =TRANSLATE(arg(2))
| ts_arg =TRANSLATE(path_name)
| free_mrk ="DIR(S)"
|
| 'dir /-c 'path_name' | rxqueue'
| fil_siz = -2
| free_siz = -3
|
| DO WHILE QUEUED()>0
| PARSE UPPER PULL SS1
| PARSE VALUE SS1 WITH ss1_0 ss1_1 ss1_2 ss1_3
| IF POS(ss1_3,ts_arg)>0 THEN fil_siz = ss1_2
|
| IF POS(free_mrk,ss1)>0 THEN free_siz = ss1_2
|
| END
|
| ret_val=-1
|
| SELECT
| WHEN w32_comm='SIZE'
| THEN ret_val=fil_siz
| WHEN w32_comm='FREE'
| THEN ret_val=free_siz
| OTHERWISE
| ret_val = -1
| END
|
| RETURN ret_val

You might want to show us the output of the
DIR/-C
commond on your system. Here is mine (Windows/XP):
=============================================================================
Volume in drive D is ----D-----
Volume Serial Number is 68D0-6356

Directory of D:\

12/16/2005 07:54 PM <DIR> docume~1 documents and settings
01/15/2006 10:33 AM <DIR> progra~1 program files
03/03/2006 11:49 PM <DIR> recycled recycled
12/16/2005 08:29 PM <DIR> system~1 system volume information
12/17/2005 03:17 PM <DIR> temp
12/16/2005 07:42 PM <DIR> windows
03/12/2007 09:14 AM 212578 2_rr-b~1.jpe 2_rr-bks.jpeg
05/18/2007 11:51 AM 1069 bigfile.rex
01/06/2006 02:43 PM 211 boot.ini
05/18/2007 11:39 AM 1479 dir(s)
12/16/2005 08:18 PM 0 io.sys
12/16/2005 08:18 PM 0 msdos.sys
08/04/2004 12:00 PM 47564 ntdetect.com
08/04/2004 12:00 PM 250032 ntldr
8 File(s) 512933 bytes
6 Dir(s) 15119417344 bytes free
=============================================================================
Note that I have a file named dir(s) which really
barfs up the compare; the code below fixes that.

Also note that I most certainly have a different (DIR output) format
than you have on your system.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
/**/ arg yfile ywhat .; say '-----------' GetFileSizeWin32(yfile ywhat)
exit

/*--------------------------------------------------------------+
| Procedure GetFileSizeWin32 |
| returns the size of file (since the native REXX functions |
| broke at 2-4Gb) |
| --or-- it can return the free space on the drive
 
 
 

Big files size in WinXP+ system

Post by olegs.zirn » Tue, 22 May 2007 17:31:01


Yep, code was just a sample. "Problem" is, that I always use 24h time
format, so - do not care about am/pm "additional column" in dir, can
be fixed by ~two lines..., but it's really "Q&D fix", so, we wait for
version 4.n.n.n :)