Author Topic: About comparing and synchronising files on the internet  (Read 2065 times)

0 Members and 1 Guest are viewing this topic.

bilançikur

  • Newt
  • Posts: 82
About comparing and synchronising files on the internet
« on: February 17, 2015, 12:56:23 PM »
Hi there,

My goal is to try to write a progam (or at least try to find out if such program would be possible at all) that would download all VLX/FAS/LSP files in a specific folder somewhere on the internet.

I was reading some interesting post over here:
http://www.theswamp.org/index.php?topic=13.0

With this approach one would need to know the exact name of a file and extension.
In my case I have no idea what the name is.

If this could be achieved, then I would have a temporary folder where these VLX/FAS/LSP files will be stored.
Next is to copy them to a certain support path folder where existing files are overwritten and new files are added.
Then delete the temp flder and load all the files in my support path folder.
I know it is a huge job but I believe it can all be done easy except the part where I dont know the file name and extension.

Any thoughts on this one?

Thanks already!


ronjonp

  • Needs a day job
  • Posts: 7529
Re: About comparing and synchronising files on the internet
« Reply #1 on: February 17, 2015, 02:09:49 PM »
Maybe your program has a version number that it checks. If the version number does not match, copy your files to a temp location. Then you could use this to update the files.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

bilançikur

  • Newt
  • Posts: 82
Re: About comparing and synchronising files on the internet
« Reply #2 on: February 17, 2015, 03:51:40 PM »
Maybe your program has a version number that it checks. If the version number does not match, copy your files to a temp location. Then you could use this to update the files.

Thanks Ronjonp for the reply and link. In that case I should know the name of the file.
Maybe I should approach it like this: have 1 file in the folder wich is always the same name.
Use the program to download, open and read that file.
The contents of that ile should be the names of the files to be updated.

Hmm... just thinking. Mabe it is an idea.

ChrisCarlson

  • Guest
Re: About comparing and synchronising files on the internet
« Reply #3 on: February 17, 2015, 04:02:27 PM »
You could read the file from the internet and do a quick search within the file for a version number, or since bandwidth is cheap and file sizes are small, you could write the routine each time, ensuring it's always current.

Look here
http://www.theswamp.org/index.php?topic=45238.0


bilançikur

  • Newt
  • Posts: 82
Re: About comparing and synchronising files on the internet
« Reply #4 on: February 20, 2015, 04:00:39 AM »
Thanks Chris!

What I get as a return (in a *.txt file on my works server) is this:

Code: [Select]
"Line 1\n\nLine 2\n\nLine 3"Al rules turn to 1 string with the \N new rule formatting.

How would I get it like this:
Code: [Select]
"Line 1"
"Line 2"
"Line 3"

Imagine I have 3 lisp file on the server, in that folder.
It should return te filenames so I can then download them one by one.

I cannot use the read-line function, also I cannot split this one string.
Any light on this one?

ronjonp

  • Needs a day job
  • Posts: 7529
Re: About comparing and synchronising files on the internet
« Reply #5 on: February 20, 2015, 08:31:00 AM »
...
I cannot use the read-line function, also I cannot split this one string.
Any light on this one?


Do a search for parse string and you'll find what you need.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

bilançikur

  • Newt
  • Posts: 82
Re: About comparing and synchronising files on the internet
« Reply #6 on: February 20, 2015, 08:57:04 AM »
Ronjonp: thanks but I believe I am on the wrong path...
I think I could better download that file, then I can use the read-line function.

Will be trying in between work whenever I have some spare moment.s