downloaded file content <> content url()

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

downloaded file content <> content url()

Post by jmburnod » Wed Oct 17, 2012 9:14 pm

Hi All,
I downloaded a simple .txt file from an http url. I need to compare the content of downloaded file with the content of the file on the http.

Code: Select all

on mouseUp
   put "http://www.alternatic.ch/jmb/ecrireenpictos/ArchInstallEEP" & "/" & "listeFolderEEP2.txt" into tlisteFolderEEP2
   put url (tlisteFolderEEP2) into tListeInstall1
   put specialfolderpath("documents") & "/" & "listeFolderEEP2.txt" into tPathInstall
   libURLDownloadToFile tlisteFolderEEP2,tPathInstall
   wait 30
   put url("file:" & tPathInstall) into tListeInstall2
   put (tListeInstall1 = tListeInstall2) & cr & tListeInstall1 & cr & cr & tListeInstall2 -- return false, some cr disappear
end mouseUp

I expected get the same data in the file where i downloaded the file by libURLDownloadToFile and the data i obtained by "put url", but there is not the case.

What is the trick to avoid this ?

Thanks

Jean-Marc
https://alternatic.ch

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: downloaded file content <> content url()

Post by Mark » Wed Oct 17, 2012 9:31 pm

Hi Jean-Marc,

I don't understand why you want this, but probably

Code: Select all

 put url("file:" & tPathInstall) into tListeInstall2
should be

Code: Select all

 put url("binfile:" & tPathInstall) into tListeInstall2
Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: downloaded file content <> content url()

Post by jmburnod » Wed Oct 17, 2012 9:49 pm

Hi Mark
Yes. It is what i want
I don't understand why you want this
To compare the content of the file on the disk and the file on the server.

Thanks again
Jean-Marc
https://alternatic.ch

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: downloaded file content <> content url()

Post by Mark » Wed Oct 17, 2012 10:21 pm

Jean-Marc,

Why would you want to compare two files that you have downloaded from the same location?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: downloaded file content <> content url()

Post by jmburnod » Thu Oct 18, 2012 12:56 pm

Mark,
Why would you want to compare two files that you have downloaded from the same location?
Because the file on the server can be changed and i want know if it changed or not.
Jean-Marc
https://alternatic.ch

Post Reply