Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

File Update Detection

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a program that try to detect any of its files updates(Datas), because some updates are necessary to make the program work correctly, well for long time I've been comparing the last change of File in my FTP With the user File in his System.
Well but that way is kindly complicated, because if FTP Update for some reason, all files are going to be updated for the user(Also some users experienced problems, like not finding updates), then I decided to make a new system and started with a file checksums comparator, well it take (UserFile CheckSum, then take URL File Checksum) and compare each other, well it works but the problem is that I have to compare the same amount of bytes, and to make 100% sure that the file is the same I have to compare the whole file, and to compare the Whole File from URL Take too much time to do in each program startup, and without some updates the program may crash so those are important.

So... I'm here to ask you a suggestion on how I Could make a decent file updater
I'm trying to avoid store each file version in files or something like that...
Thanks =D

Edit: What I was thinking, is write all files CheckSum in a file, then user when startup program and check file and read all checksums and compare them ^^ The bad thing of that is... That on every update I gotta create a new list of CheckSums ^^
Or I could make it connect to a server that will send the list of checksums ^^ but that's a bit annoying ;/
 
Marshal
Posts: 22461
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're using Java 7 you can use java.nio.file.WatchService for this.
 
Persio Berberian
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well but this WatchService is a listener for local files, I need a listener for files in my FTP, because client is supposed to download updated files ^^
 
Sheriff
Posts: 26798
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doesn't your FTP client software give you a way to find the last changed date of a file on the server? Using that date would be easier than using a checksum.
 
Persio Berberian
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I said that's what I'm doing for loong time, checking last file changed date, but that way is not good.
Oh well then you agree with me about make an Update Server :p
As I said, I don't like the "last changed" way to make those updates, if I make an update server I can compare by checksum as the server will send checksums instead of client read them from file itself :p
PS: Still searching for more suggestions :p
 
Marshal
Posts: 74085
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too difficult for “beginning”. Moving thread.
 
Persio Berberian
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, maybe I'll get more opinions, by the way I already created my Update Server, when client login it open connection to update server then send a packet asking for all file checksum, then server parse packet and send the checksum that are stored in a list that refresh every 20 seconds, then client compare each checksum received that come with filename, with local computer files, if there are any file with different checksum the client will send another packet requesting the download of file that's different :p, then server will parse this packet and send file to client :p What about?




But I'm crazy for more suggestions, because Idk... what if update server become off-line I need an optional way :p
 
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic