Liberty BASIC Community Forum
« File Check Question »

Welcome Guest. Please Login or Register.
Feb 22nd, 2018, 12:28pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1 2 3  Notify Send Topic Print
 veryhotthread  Author  Topic: File Check Question  (Read 2813 times)
steven6446
New Member
Image


member is offline

Avatar




PM


Posts: 3
xx File Check Question
« Thread started on: Dec 28th, 2002, 4:54pm »

Is there anyway to vareify that two files are the same?

I have had a go using strings but i couldent get it to work

the reasion i want this is so i can create a automated program that checks a website page for any updates and alert me if detected


steve
ps. thanks for any help smiley
User IP Logged

steven6446
New Member
Image


member is offline

Avatar




PM


Posts: 3
xx Re: File Check Question
« Reply #1 on: Dec 29th, 2002, 09:04am »

i take it that it cant be done then due to no one has responded undecided
User IP Logged

Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14923
xx Re: File Check Question
« Reply #2 on: Dec 29th, 2002, 12:30pm »

Quote:
Is there anyway to vareify that two files are the same


Look up the FILES command in the helpfile. You will find that it fills a double dimensioned array with file info, including the name, size and time/date stamp. For a file on disk, you can check these to see if they match. For a file on the internet? I don't know. Why don't you search on the many programming and internet-programming websites, the MSDN, and even google, and find the answer and share it with the rest of us?
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
steven6446
New Member
Image


member is offline

Avatar




PM


Posts: 3
xx Re: File Check Question
« Reply #3 on: Dec 29th, 2002, 2:24pm »

well it might be possible to use the CRC dll at :
http://groups.yahoo.com/group/libertybasic/files/CRC.dll

but there is no example code so i cant use it
User IP Logged

Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14923
xx Re: File Check Question
« Reply #4 on: Dec 29th, 2002, 4:26pm »

on Dec 29th, 2002, 2:24pm, steven6446 wrote:
well it might be possible to use the CRC dll at :
http://groups.yahoo.com/group/libertybasic/files/CRC.dll

but there is no example code so i cant use it


Steven,

I will again advise you to use the nifty search feature at yahoo groups. I put "crc.dll" into the textbox and clicked the search button and quickly came up with this message:

http://groups.yahoo.com/group/libertybasic/message/11011

The message content is:

Code:
' Getting the CRC of a File
' Liberty BASIC FUNCTION by Dave Thomas 29-NOV-2002
' CRC.DLL (FREEWARE)has been uploaded to the Files area
' Feel free to use the code in your own programs
FileDialog "Select File","*.*",File$
OPEN File$ FOR APPEND AS #1
Size=LOF(#1)
CLOSE #1

FileCRC$=CRC$(File$)
NOTICE "[FILE INFO]"+_
CHR$(13)+"FILENAME : "+File$+_
CHR$(10)+"FILESIZE : "+STR$(Size)+" Bytes"+_
CHR$(10)+"CRC : ";FileCRC$

END

NOMAINWIN

FUNCTION CRC$(Filename$)
Filename$=Filename$+CHR$(0)
OPEN "CRC.DLL" FOR DLL AS #CRC
CALLDLL #CRC,"CRC",Filename$ As Ptr,Result As uLong
CRC=Result
CLOSE #CRC
CRC$=RIGHT$("00000000"+DECHEX$(CRC),8)
END FUNCTION
 
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
steven6446
New Member
Image


member is offline

Avatar




PM


Posts: 3
xx Re: File Check Question
« Reply #5 on: Dec 29th, 2002, 4:37pm »

Thanx for searching that out for me smiley, i dont ususaly use the search feature because it ususaly brings up no results to things it should or things it shouldent.

Sorry to be so annoying

steve
User IP Logged

Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14923
xx Re: File Check Question
« Reply #6 on: Dec 29th, 2002, 4:46pm »

on Dec 29th, 2002, 4:37pm, steven6446 wrote:
Sorry to be so annoying

steve


Glad to help. It is not annoying to find answers to coding questions. That is why we are all here... to share. Good luck.

Alyce
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
steven6446
New Member
Image


member is offline

Avatar




PM


Posts: 3
xx Re: File Check Question
« Reply #7 on: Dec 30th, 2002, 07:40am »

it seems to work great untill you try to encode it into a tkn huh

Error: Runtime Error-key is missing.

error log file:



Error log timestamp Monday 02-12-30 01:40:01 PM

Runtime error: Key is missing

Error(Exception)>>grinefaultAction
Error(Exception)>>activateHandler: <anUndefinedObject>
Error(Exception)>>handle
Error(Exception)>>signal
Error class(Exception class)>>signal: <'Key is missing'>
Dictionary(Object)>>error: <'Key is missing'>
Dictionary>>errorAbsentKey
LinearHashTable>>lookUpValue: <#uLong> for: <aDictionary>
Dictionary>>at: <#uLong>
DynamicLinkLibrary class>>typeIndex: <#uLong>
DynamicLinkLibrary>>laughrogram: <aBasicRunProgram> call: <'CRC'> arguments: <anArray> types: <anArray> returns: <#uLong>
CalldllCommand>>value
BasicRunProgram>>begin
BasicRunProgram(BasicProgram)>>run
BasicOnDemandCompiler class>>readTknFile: <aFileStream> callingProgram: <anUndefinedObject> commandLine: <''>
Basic class>>start
Message>>laugherform
NotificationManager>>empty
NotificationManager>>runPendingEvents
NotificationManager>>runEventLoop
Message>>laugherform
Message>>evaluate
Process>>safelyEvaluate: <aMessage>
Process>>evaluate: <aMessage>
User IP Logged

Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14923
xx Re: File Check Question
« Reply #8 on: Dec 30th, 2002, 09:51am »

It worked fine for me when tokenized and run as a tkn.
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
steven6446
New Member
Image


member is offline

Avatar




PM


Posts: 3
xx Re: File Check Question
« Reply #9 on: Dec 30th, 2002, 11:10am »

well it runs ok in the editor but with the runtime engine it doesent work
User IP Logged

Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14923
xx Re: File Check Question
« Reply #10 on: Dec 30th, 2002, 11:15am »

on Dec 30th, 2002, 11:10am, steven6446 wrote:
well it runs ok in the editor but with the runtime engine it doesent work


It worked fine with the runtime engine for me. I tokenized it and copied the tkn, the DLL and all the LB runtime files to a separate directory and ran it. Did you remember to put the DLL in the same directory as the TKN or in the Windows directory?

Alyce
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
steven6446
New Member
Image


member is offline

Avatar




PM


Posts: 3
xx Re: File Check Question
« Reply #11 on: Dec 30th, 2002, 11:26am »

i have never had a problem with files being in the same directory before , i tryed it anyways and it comes up with the same error.

maybe my os is damaged or something undecided
User IP Logged

steven6446
New Member
Image


member is offline

Avatar




PM


Posts: 3
xx Re: File Check Question
« Reply #12 on: Dec 30th, 2002, 6:51pm »

well i cant fix it so i give up with that small project sad
User IP Logged

TronDoc
Full Member
ImageImageImage


member is offline

Avatar




Homepage PM


Posts: 145
xx Re: File Check Question
« Reply #13 on: Dec 30th, 2002, 7:45pm »

Alyce:
I just tried the link for the CRC.DLL along with manually
searching the yahoo group and the file comes up
not found. The posting by Dave Thomas does come up.
huh
Joe
User IP Logged

peace©®™
http://trondoc.ezwebtech.com/theWRAP
Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14923
xx Re: File Check Question
« Reply #14 on: Dec 30th, 2002, 8:14pm »

Joe,

Look at the earlier posts in this thread. Steven found the DLL in the files area of the yahoo group, but it had no sample code. I found the code in the messages. Just look in the files area. In addition, the author just started an LB API yahoo group with the DLL in the files area there. I don't have the URL handy, but if you search the LB Yahoo messages, you'll find the announcement. The author is Dave Thomas.

Alyce
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
Pages: 1 2 3  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls