You are not logged in.

#1 13 Apr 2020 20:13

audiogalaxy
Member
Registered: 11 Feb 2009
Posts: 13

GEQ and forfiles fsize conditional that makes me crazy

dir *.mov

13/04/2020  20:36     2.491.532.310 202002065DK4_7168_FULL60_c.mov
13/04/2020  20:36       588.191.746 202002065DK4_7176_short_c.mov

==== these are the data, and it's ok.

FORFILES /M *.mov /C "cmd /c echo @fsize"

result:

2491532310
588191746

and this is correct.

===============

FORFILES /M *.mov /C "cmd /C if @fsize GEQ 4000000000 (echo @fname>>log_error.sux) ELSE (echo @file size check: passed)"

resulting echo:

"202002065DK4_7176_short_c.mov" size check: passed

===

type log_error.sux

result:

"202002065DK4_7168_FULL60_c"

==============

I can't handle. I'm going crazy. WTF??? mad roll


(sorry for my bad english)

Offline

#2 14 Apr 2020 10:30

RG
Member
From: Minnesota
Registered: 18 Feb 2010
Posts: 362

Re: GEQ and forfiles fsize conditional that makes me crazy

4000000000 is a larger number than can be handled.

SET /A should work within the full range of 32 bit signed integer numbers (-2,147,483,648 through 2,147,483,647) but in practice for negative integers it will not go below -2,147,483,647
https://ss64.com/nt/set.html


Windows Shell Scripting and InstallShield

Offline

#3 14 Apr 2020 20:58

audiogalaxy
Member
Registered: 11 Feb 2009
Posts: 13

Re: GEQ and forfiles fsize conditional that makes me crazy

RG wrote:

4000000000 is a larger number than can be handled.

SET /A should work within the full range of 32 bit signed integer numbers (-2,147,483,648 through 2,147,483,647) but in practice for negative integers it will not go below -2,147,483,647
https://ss64.com/nt/set.html

thanks RG!


(sorry for my bad english)

Offline

#4 15 Apr 2020 18:28

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: GEQ and forfiles fsize conditional that makes me crazy

I just added a line to the IF page about the numeric limits.

Offline

#5 16 Apr 2020 14:38

RG
Member
From: Minnesota
Registered: 18 Feb 2010
Posts: 362

Re: GEQ and forfiles fsize conditional that makes me crazy

Thank you Simon.


Windows Shell Scripting and InstallShield

Offline

Board footer

Powered by