| View previous topic :: View next topic |
| Author |
Message |
noveltech Contributor

Joined: 16 Sep 2002 Posts: 105
|
Posted: Mon Nov 24, 2003 12:58 am Post subject: File, verify file size? |
|
|
How do we verify file size ?
Verify a specific file size b4 the script continues...if file size has changed...stop the program.
Thanks for all feed back, nt |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Nov 24, 2003 1:02 am Post subject: |
|
|
You can use this:
| Code: | if @not(@equal(@file(@path(%0)myfile.ext,Z),1024))
warn Sorry the file size is not correct
exit
end |
Note that if you have VDS 5 you can use @unequal() instead of @not(@equal())
1024 is the size in bytes you're checking.
I hope this helps.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
noveltech Contributor

Joined: 16 Sep 2002 Posts: 105
|
Posted: Mon Nov 24, 2003 3:58 am Post subject: Thank you |
|
|
Thanks, FreezingFire
Using vds 5, i am doing something wrong.
using: %D = C:\Program Files\My Program\actres.exe
File size = 15360
Actual Size = 15384
Window reports it both ways under properties window.
if @not(@equal(@file(@path(%0)myfile.ext,Z),1024))
OR?
@unequal(@file(@path(%0)%D,Z),15384))
Where would I place my key assignment in the above lines of code?
Thanks, nt |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Nov 24, 2003 6:51 am Post subject: |
|
|
Firstly, you have to use the file's actual size in your function - file size refers to the disk space taken by the
file and it will vary according to the disk's cluster size.
Secondly, you can of course use @unequal() when you're using VDS5. But you gotta adjust your parentheses so they
match (you have an extra one in your example ). E.g.
| Code: | %D = "C:\Program Files\My Program\actres.exe"
%%FSize = 15384
if @unequal(@file(%D,Z),%%FSize)
info File size does not match!
end |
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
|