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 


Anyway to know if filesize changed by without knowing its or

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


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Thu Mar 11, 2004 11:58 pm    Post subject: Anyway to know if filesize changed by without knowing its or Reply with quote

I have files that get corrupted from time to time, and the file size changes to a much smaller size(but unpredictible filesize).
Is there a way to read the corrupted file and find out what its original filesize was?

The file extension is .WDG and is a map for a game.

Thanks for reading this..
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Mar 12, 2004 12:08 am    Post subject: Reply with quote

You can use @file() with the "Z" parameter to check a file's size. Wink

Code:

if @file(c:\gamefiles\mywidget.wdg)
   INFO File size is @file(c:\gamefiles\mywidget.wdg, Z)
end


Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Mar 12, 2004 12:13 am    Post subject: Reply with quote

OOPS...

Sorry, I just realized you want the original info after the
file is changed. Embarassed

The only way I know to do this is write the original file size
to a file or reg key and check the current size against that.

Not sure how accurate any of this will be if the file is
corrupted though. Confused

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Mar 12, 2004 3:05 am    Post subject: Reply with quote

Yeah, theres 100's of maps too, so I guess I'll have to register each map manually or with the program probably be easier and more acurate, plus It will have to detect what OS since they read a bit differently.

What happens is when the custom homemade map is downloaded in the game menu, some people impatiently cancel the download and the map file is at whatever size downloaded, and is spread to posibly other players.

I was wondering if there was a way to get(or use) the file property tags below somehow to tell if the map file it was corrupted recently:

< File Properties: >
Created:
Modified:
Accessed:
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Mar 12, 2004 4:44 am    Post subject: Reply with quote

You could append a signature at the end of the file. Your prog
could check for this (with file IO) to validate the file is intact.
This method or a CRC check (I have no clue about CRC) is
prolly the most easy/accurate. Wink

Otherwise you prolly would need a master list to avoid errors
caused by stopping the map downloads. Not sure what the diff
is on different OS file systems, but there's prolly routines for
checking that on the net.

BTW, a text file (.dat or whatever) with each filename|size
can be made fairly easy using the LIST FILELIST command
and a loop. You can use @match() to find the filename, and
then parse the item to get the original size. Wink
__________________________________________________________________________________________________
Code:

LIST CREATE, 1
DIRECTORY CHANGE, c:\gamefiles

rem -- NOT using full path loads filenames only (no path) --
LIST FILELIST, 1, *.wdg

%x = 0
REPEAT
  %%item = @item(1, %x)
  LIST PUT, 1, %%item"|"@file(%%item, Z)
  %x = @succ(%x)
UNTIL @equal(%x, @count(1))

LIST SAVEFILE, 1, c:\gamefiles\widgets.dat


Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Mar 12, 2004 5:19 am    Post subject: Reply with quote

Yes, I allready have the Filelist loopy, and its more complicated than the one you just posted, because the games MODs and Game updates /etc. are also same file EXT .WDG, and I'm pritty sure the game would reject and CRC added.

I think I'll go with the master log because most stick to 3 or 4 popular maps and if a map wasnt on the master list the program could suggest deleted the un-certified map.

I'll prolly have to Dialog LIST BOX's:
(LEFT window = maps that are OK)
(RIGHT window = map unknown

Thats the main thing to protect the most POPULAR maps, because many people attempt to make maps and they are failures, hehe.

Thanks for helping me with this MAC, appreciate you even reading all this Wink
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Mar 12, 2004 7:23 am    Post subject: Reply with quote

You're welcome - let us know if/when/how ya solve the problem. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Protected
Valued Contributor
Valued Contributor


Joined: 02 Jan 2001
Posts: 228
Location: Portugal

PostPosted: Fri Mar 12, 2004 9:27 am    Post subject: Reply with quote

CRC would be a nice method (I know it works good), even though it might not be worth the work - it would be better if the files didn't get corrupted, to begin with := Are they maps from a game coded by you? Shouldn't you just try to fix the code, if that's the case?
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Mar 12, 2004 10:07 am    Post subject: Reply with quote

Protected, I think the problem is when users only partially
download some of his files... Wink
vtol777 wrote:

What happens is when the custom homemade map is downloaded in the game menu, some people impatiently cancel the download and the map file is at whatever size downloaded, and is spread to posibly other players.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Mar 12, 2004 9:16 pm    Post subject: Reply with quote

naa, its a popular game (that I had nothing to do with - I just make maps MODs and utilitys for the game.) source code not released.
They went outta business 5 years ago right after game was finished, and it has a bad downloader for maps(don't work so good).
So I can't fix anything, I just have to work around the problem.

Thanks for the help guys, appreciate it.
Back to top
View user's profile Send private message Visit poster's website
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