forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


File, verify file size?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
noveltech
Contributor
Contributor


Joined: 16 Sep 2002
Posts: 105

PostPosted: Mon Nov 24, 2003 12:58 am    Post subject: File, verify file size? Reply with quote

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
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Nov 24, 2003 1:02 am    Post subject: Reply with quote

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. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
noveltech
Contributor
Contributor


Joined: 16 Sep 2002
Posts: 105

PostPosted: Mon Nov 24, 2003 3:58 am    Post subject: Thank you Reply with quote

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
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Nov 24, 2003 6:51 am    Post subject: Reply with quote

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 Wink ). 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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group