Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #320 > unrolled thread

a program to read/compare the size of files on some websites?

Started byRoger Darlington <rogerarm@freeuk.com>
First post2011-05-20 17:23 +0100
Last post2011-05-29 16:26 +0100
Articles 20 on this page of 33 — 12 participants

Back to article view | Back to comp.sys.acorn.programmer


Contents

  a program to read/compare the size of files on some websites? Roger Darlington <rogerarm@freeuk.com> - 2011-05-20 17:23 +0100
    Re: a program to read/compare the size of files on some websites? Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2011-05-20 21:17 +0100
      Re: a program to read/compare the size of files on some websites? Roger Darlington <rogerarm@freeuk.com> - 2011-05-20 21:45 +0100
        Re: a program to read/compare the size of files on some websites? Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2011-05-20 22:49 +0100
        Re: a program to read/compare the size of files on some websites? Roger Darlington <rogerarm@freeuk.com> - 2011-05-22 07:28 +0100
          Re: a program to read/compare the size of files on some websites? Steve Fryatt <news@stevefryatt.org.uk> - 2011-05-22 13:28 +0100
            Re: a program to read/compare the size of files on some websites? Roger Darlington <rogerarm@freeuk.com> - 2011-05-22 16:19 +0100
        Re: a program to read/compare the size of files on some webs jgh@arcade.demon.co.uk (Jonathan Graham Harston) - 2011-05-22 17:30 +0100
          Re: a program to read/compare the size of files on some webs Roger Darlington <rogerarm@freeuk.com> - 2011-05-24 14:36 +0100
    Re: a program to read/compare the size of files on some websites? Steve Fryatt <news@stevefryatt.org.uk> - 2011-05-21 10:29 +0100
      Re: a program to read/compare the size of files on some websites? Andrew Hodgkinson <ahodgkin@rowing.org.uk> - 2011-05-21 10:39 +0100
      Re: a program to read/compare the size of files on some websites? Roger Darlington <rogerarm@freeuk.com> - 2011-05-21 13:13 +0100
        Re: a program to read/compare the size of files on some websites? Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-05-22 03:37 +0200
          Re: a program to read/compare the size of files on some websites? Roger Darlington <rogerarm@freeuk.com> - 2011-05-22 07:17 +0100
            Re: a program to read/compare the size of files on some websites? "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-05-22 09:45 +0200
              Re: a program to read/compare the size of files on some websites? Steve Fryatt <news@stevefryatt.org.uk> - 2011-05-22 10:31 +0100
                Re: a program to read/compare the size of files on some websites? "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-05-22 12:57 +0200
                  Re: a program to read/compare the size of files on some websites? Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-05-24 01:11 +0200
                    Re: a program to read/compare the size of files on some websites? Alan Adams <alan@adamshome.org.uk> - 2011-05-24 17:30 +0100
                Re: a program to read/compare the size of files on some websites? Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-05-24 01:03 +0200
              Re: a program to read/compare the size of files on some websites? Roger Darlington <rogerarm@freeuk.com> - 2011-05-22 16:41 +0100
            Re: a program to read/compare the size of files on some websites? Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-05-24 00:57 +0200
              Re: a program to read/compare the size of files on some websites? Roger Darlington <rogerarm@freeuk.com> - 2011-05-24 14:14 +0100
        Re: a program to read/compare the size of files on some websites? Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2011-05-22 18:54 +0100
          Re: a program to read/compare the size of files on some websites? Roger Darlington <rogerarm@freeuk.com> - 2011-05-23 07:08 +0100
            Re: a program to read/compare the size of files on some websites? jgharston <jgh@arcade.demon.co.uk> - 2011-05-23 08:01 -0700
            Re: a program to read/compare the size of files on some websites? Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-05-24 01:44 +0200
              Re: a program to read/compare the size of files on some webs jgh@arcade.demon.co.uk (Jonathan Graham Harston) - 2011-05-29 23:49 +0100
                Re: a program to read/compare the size of files on some webs Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-05-30 12:11 +0200
                  Re: a program to read/compare the size of files on some webs Frank de Bruijn <zuiderduin@hotmail.com> - 2011-05-31 07:45 +0200
                Re: a program to read/compare the size of files on some webs Frank de Bruijn <zuiderduin@hotmail.com> - 2011-05-31 07:38 +0200
    Re: a program to read/compare the size of files on some websites? Ron <beeb@woosh.co.nz> - 2011-05-29 20:50 +1200
    Re: a program to read/compare the size of files on some websites? Ron Briscoe <ron.briscoe@blueyonder.co.uk> - 2011-05-29 16:26 +0100

Page 1 of 2  [1] 2  Next page →


#320 — a program to read/compare the size of files on some websites?

FromRoger Darlington <rogerarm@freeuk.com>
Date2011-05-20 17:23 +0100
Subjecta program to read/compare the size of files on some websites?
Message-ID<e3d16bd651.rogerarm@rogerarm.freeuk.com>
Has anyone written, or know of, a program that will compare the 
filesizes of files on a local copy of a website, with that on the 
website itself.

It has, in the past, been claimed that this is not possible. But to 
me, on my website, it looks eminently possible, because using FTPc I 
can see the filesizes of the files on the website itself.

But rather than start writing a program from scratch, someone must 
have written a program that does likewise. It may not work on every 
website, but it should be possible to write one that works on SOME 
websites meethinks, in particular those websites that allow the 
reading of filesizes...




-- 

Cheers
Roger
If I was going there, I wouldn't start from here.

[toc] | [next] | [standalone]


#321

FromJeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk>
Date2011-05-20 21:17 +0100
Message-ID<mpro.lligcx003wvus01lk@wingsandbeaks.org.uk.invalid>
In reply to#320
Roger Darlington <rogerarm@freeuk.com> wrote:

> 
> Has anyone written, or know of, a program that will compare the 
> filesizes of files on a local copy of a website, with that on the 
> website itself.
> 
> It has, in the past, been claimed that this is not possible. But to 
> me, on my website, it looks eminently possible, because using FTPc I 
> can see the filesizes of the files on the website itself.

A server that allows FTP access to a directory holding files is not the same
thing as "a website".  Webservers often do not allow access to file
directories.

Even when you upload files to a webserver using FTP, the place you upload
them to is - in some cases - a virtual directory from which the server moves
the files to their required final position.



In general if you ask about a program to see files on a website, people will
assume you mean "any website".  It seems that what you mean is your own
website, which is altogether a different thing, as you know the location and
access password for it...


Does FTPc allow one to save a directory list?  

I'm not sure about RO, but it's possible that under eg Windows that an ftp
specification of a directory can be used as a target for a dir to be
investigated (by any disk scanning tool) in much the same way that network
shares can be. 



-- 
Jeremy C B Nicoll - my opinions are my own.

Email sent to my from-address will be deleted. Instead, please reply
to newsreplyaaa@wingsandbeaks.org.uk replacing "aaa" by "284".  

[toc] | [prev] | [next] | [standalone]


#322

FromRoger Darlington <rogerarm@freeuk.com>
Date2011-05-20 21:45 +0100
Message-ID<67d683d651.rogerarm@rogerarm.freeuk.com>
In reply to#321
On 20 May 2011, Jeremy Nicoll - news posts  wrote:
> Roger Darlington <rogerarm@freeuk.com> wrote:

>> 
>> Has anyone written, or know of, a program that will compare the
>> filesizes of files on a local copy of a website, with that on the
>> website itself.
>> 
>> It has, in the past, been claimed that this is not possible. But to
>> me, on my website, it looks eminently possible, because using FTPc I
>> can see the filesizes of the files on the website itself.

> A server that allows FTP access to a directory holding files is not the same
> thing as "a website".  Webservers often do not allow access to file
> directories.

> Even when you upload files to a webserver using FTP, the place you upload
> them to is - in some cases - a virtual directory from which the server moves
> the files to their required final position.



> In general if you ask about a program to see files on a website, people will
> assume you mean "any website".  It seems that what you mean is your own
> website, which is altogether a different thing, as you know the location and
> access password for it...

Yes, it is for my website.

> Does FTPc allow one to save a directory list?

It does, but I have to go into that directory to get the list with 
filesizes, and when there are hundreds of (nested) directories that 
would be a laborious process to do manually.


> I'm not sure about RO, but it's possible that under eg Windows that an ftp
> specification of a directory can be used as a target for a dir to be
> investigated (by any disk scanning tool) in much the same way that network
> shares can be.





-- 

Cheers
Roger
If you collect them, then, one day - you'll have a lot.

[toc] | [prev] | [next] | [standalone]


#323

FromJeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk>
Date2011-05-20 22:49 +0100
Message-ID<mpro.lliklx0076y9a01lk@wingsandbeaks.org.uk.invalid>
In reply to#322
Roger Darlington <rogerarm@freeuk.com> wrote:

> On 20 May 2011, Jeremy Nicoll - news posts  wrote:

> > Does FTPc allow one to save a directory list?
> 
> It does, but I have to go into that directory to get the list with 
> filesizes, and when there are hundreds of (nested) directories that 
> would be a laborious process to do manually.

I think curl or wget might help.  Google will get you lots of info about
both.  I know there's a RO port of curl and probably wget as well.

I googled for "curl get directory listing" and one of the hits

  http://www.codediesel.com/tools/6-essential-curl-commands/


suggests it's dead easy.  So what you'd be looking at is a program that
issues multiple curl requests, either explicitly roueting the outout to a
file which your rpogram then reads, or redirecting output to such a file.

 
Apart from getting the ftp directory listing (as suggested in that article)
it's possible filesize is in the http headers returned for an http file
request.  Curl certainly allows one to grab file headers separately from
(and perhaps instead of) a file.  But iterating through your site file by
file might be harder than successive requests for directory lists. 



I've previously used curl from RO to grab a newspaper's main web page, then
extract some info from the html source and issue another request to fetch
another page, and so ending up with a [crossword puzzle] page whose URL
could not be guessed up front.  

(Actually I think I may have outlined this process in an email to you some
time ago.)

-- 
Jeremy C B Nicoll - my opinions are my own.

Email sent to my from-address will be deleted. Instead, please reply
to newsreplyaaa@wingsandbeaks.org.uk replacing "aaa" by "284".  

[toc] | [prev] | [next] | [standalone]


#333

FromRoger Darlington <rogerarm@freeuk.com>
Date2011-05-22 07:28 +0100
Message-ID<94f83cd751.rogerarm@rogerarm.freeuk.com>
In reply to#322
On 20 May 2011, Roger Darlington  wrote:
> On 20 May 2011, Jeremy Nicoll - news posts  wrote:
>> Roger Darlington <rogerarm@freeuk.com> wrote:


>>> It has, in the past, been claimed that this is not possible. But to
>>> me, on my website, it looks eminently possible, because using FTPc I
>>> can see the filesizes of the files on the website itself.

>> A server that allows FTP access to a directory holding files is not the same
>> thing as "a website".  Webservers often do not allow access to file
>> directories.

So what is FTPc seeing when I look with it (on my website) when it 
tells me the filesizes of the files in any particular directory? If 
the size it reports is not the size of the files on the website, then 
isn't something drastically wrong somewhere?

I can only assume that FTPc is telling me the correct sizes of the 
files on my website (whether or not it is actually looking at some 
virtual copy somewhere). In which case, I should be able to knock up a 
program on my local computer which uses FTPc (or cURL or somesuch) to 
read the filesizes.

Unless, of course, someone has already knocked up a program to do 
this, that they would be willing to lend me...

-- 

Cheers
Roger
If you start nowhere, you'll finish up in the same place

[toc] | [prev] | [next] | [standalone]


#334

FromSteve Fryatt <news@stevefryatt.org.uk>
Date2011-05-22 13:28 +0100
Message-ID<mpro.llljzw07641w001l7.news@stevefryatt.org.uk>
In reply to#333
On 22 May, Roger Darlington wrote in message
    <94f83cd751.rogerarm@rogerarm.freeuk.com>:
 
> So what is FTPc seeing when I look with it (on my website) when it tells
> me the filesizes of the files in any particular directory? If the size it
> reports is not the size of the files on the website, then isn't something
> drastically wrong somewhere?
> 
> I can only assume that FTPc is telling me the correct sizes of the files
> on my website (whether or not it is actually looking at some virtual copy
> somewhere). In which case, I should be able to knock up a program on my
> local computer which uses FTPc (or cURL or somesuch) to read the
> filesizes.

Using FTP that's fine (see my other post for how to do it using FTPc).

Your original post didn't make it clear that it was for use only on your
site, or that you had FTP access to all the sites in question, so several of
us assumed that you were after a general solution that would have to work
via HTTP.  That's a lot more difficult to do, hence the complex work-arounds
that are being proposed.

One other thought re the FTPc solution that I didn't make clear: the API is
via Wimp User Messages, so you'll need to write a fully multitasking
application that calls Wimp_Poll.  It doesn't need to have windows, an
iconbar presence, or whatever, of course (and it could hijack something like
Reporter for display output if that helped).

-- 
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/

[toc] | [prev] | [next] | [standalone]


#335

FromRoger Darlington <rogerarm@freeuk.com>
Date2011-05-22 16:19 +0100
Message-ID<24956dd751.rogerarm@rogerarm.freeuk.com>
In reply to#334
On 22 May 2011, Steve Fryatt  wrote:

> One other thought re the FTPc solution that I didn't make clear: the API is
> via Wimp User Messages, so you'll need to write a fully multitasking
> application that calls Wimp_Poll.  It doesn't need to have windows, an
> iconbar presence, or whatever, of course (and it could hijack something like
> Reporter for display output if that helped).

Ah, OK, I see. Thanks Steve.. That kind of puts the kybosh on that 
idea then, as I'd have to learn how to write a wimp program first :-(


-- 

Cheers
Roger
The PC standard: no two machines alike.

[toc] | [prev] | [next] | [standalone]


#338 — Re: a program to read/compare the size of files on some webs

Fromjgh@arcade.demon.co.uk (Jonathan Graham Harston)
Date2011-05-22 17:30 +0100
SubjectRe: a program to read/compare the size of files on some webs
Message-ID<110522175501@arcade.demon.co.uk>
In reply to#322
rogerarm wrote:
> > Does FTPc allow one to save a directory list?
> 
> It does, but I have to go into that directory to get the list with
> filesizes, and when there are hundreds of (nested) directories that
> would be a laborious process to do manually.
 
FTPc allows you to write other programs that call it to do various
FTP operations. http://mdfs.net/temp/ListSiteEx is a modified
version of one of the FTPc demos that recursively lists all files
and file sizes in an FTP directory. You could use it as a source to
develop a FTPdiff from.
 
-- 
J.G.Harston - jgh@mdfs.net - mdfs.net/jgh
There are three food groups: brown, green and ice cream.

[toc] | [prev] | [next] | [standalone]


#346 — Re: a program to read/compare the size of files on some webs

FromRoger Darlington <rogerarm@freeuk.com>
Date2011-05-24 14:36 +0100
SubjectRe: a program to read/compare the size of files on some webs
Message-ID<5de16bd851.rogerarm@rogerarm.freeuk.com>
In reply to#338
On 22 May 2011, Jonathan Graham Harston wrote:
> rogerarm wrote:
>>> Does FTPc allow one to save a directory list?
>> 
>> It does, but I have to go into that directory to get the list with
>> filesizes, and when there are hundreds of (nested) directories that
>> would be a laborious process to do manually.

> FTPc allows you to write other programs that call it to do various
> FTP operations. http://mdfs.net/temp/ListSiteEx is a modified
> version of one of the FTPc demos that recursively lists all files
> and file sizes in an FTP directory. You could use it as a source to
> develop a FTPdiff from.

Hi Jonathan,

Wow, that's fantastic!

It works a treat when the FTP address of my website is set inside it!

It should be relatively easy for me to do something useful with the 
output.

Many thanks!

-- 

Cheers
Roger
Sailing on the Ship of Theseus across Heraclitus' River 

[toc] | [prev] | [next] | [standalone]


#324

FromSteve Fryatt <news@stevefryatt.org.uk>
Date2011-05-21 10:29 +0100
Message-ID<mpro.lljh0e011nvq801iz.news@stevefryatt.org.uk>
In reply to#320
On 20 May, Roger Darlington wrote in message
    <e3d16bd651.rogerarm@rogerarm.freeuk.com>:

> Has anyone written, or know of, a program that will compare the filesizes
> of files on a local copy of a website, with that on the website itself.

What for?  If you're simply looking to maintain an offline copy and upload
changes, then SiteMatch may well already do what you require via a different
method.

  http://www.richardporter.me.uk/riscos/sitematch/

If you specifically want filesizes, then maybe not.
 
> It has, in the past, been claimed that this is not possible. But to me, on
> my website, it looks eminently possible, because using FTPc I can see the
> filesizes of the files on the website itself.

As Jeremy has said, you're confusing FTP and HTTP.

-- 
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/

[toc] | [prev] | [next] | [standalone]


#325

FromAndrew Hodgkinson <ahodgkin@rowing.org.uk>
Date2011-05-21 10:39 +0100
Message-ID<_KLBp.6296$2E6.1450@newsfe18.ams2>
In reply to#324
On 21/05/2011 10:29, Steve Fryatt wrote:

> What for?  If you're simply looking to maintain an offline copy and upload
> changes, then SiteMatch may well already do what you require via a different
> method.

Yep. Alternatively, Roger might be wanting to do something better suited 
to WebDAV.

   http://en.wikipedia.org/wiki/WebDAV

-- 
TTFN, Andrew Hodgkinson
Find some electronic music at:     Photos, wallpaper, software and more:
http://pond.org.uk/music.html                        http://pond.org.uk/

[toc] | [prev] | [next] | [standalone]


#326

FromRoger Darlington <rogerarm@freeuk.com>
Date2011-05-21 13:13 +0100
Message-ID<66c1d8d651.rogerarm@rogerarm.freeuk.com>
In reply to#324
On 21 May 2011, Steve Fryatt  wrote:
> On 20 May, Roger Darlington wrote in message
>     <e3d16bd651.rogerarm@rogerarm.freeuk.com>:

>> Has anyone written, or know of, a program that will compare the filesizes
>> of files on a local copy of a website, with that on the website itself.

> What for?  If you're simply looking to maintain an offline copy and upload
> changes, then SiteMatch may well already do what you require via a different
> method.

But what do you do when the two get out of sync?

Delete the lot off the website and re-upload everything??
That is 100's of MB's, which may well use up my bandwidth for the 
month...




-- 

Cheers
Roger
Yesterday never goes.

[toc] | [prev] | [next] | [standalone]


#327

FromRick Murray <heyrickmail-usenet@yahoo.co.uk>
Date2011-05-22 03:37 +0200
Message-ID<4dd868c6$0$14671$ba4acef3@reader.news.orange.fr>
In reply to#326
On 21/05/2011 14:13, Roger Darlington wrote:

> But what do you do when the two get out of sync?

...work out *why* they are out of sync first. Hacky DST changes throwing 
the filestamps off by an hour?

I wrote a scanner for Win98, and when I migrated to XP, I was horrified 
to discover that reading the file time stamp using the Win32 API 
actually mucked the times in the switch to summer time. I don't have the 
MSDN data on this machine, but I could have sworn the spec said dates 
were UTC. Evidently not...


> Delete the lot off the website and re-upload everything??

If you can nail down a cause, you can work around it.


> That is 100's of MB's, which may well use up my bandwidth for the
> month...

Fair enough. And it's also a total waste of time to upload what hasn't 
changed.


Can you run PHP? Perhaps a little hidden webpage to scan the directory 
contents and return the name, size, and some sort of checksum?

   afile.html*49403*4E2F
   index.html*2856*93A2
   resources*FOLDER*
   stuff.html*14059*670A
   xyzzy.jpeg*93840*819C

Shouldn't be too hard to do, and on your end you'll arrive at a list of 
files, their size, and a value derived from the file contents. Plus, a 
list of folders for subsequent indexing...
Oh, and in this way, you don't need to log in to anything, just call the 
(hidden) PHP script and record the result.


Best wishes,

Rick.

[toc] | [prev] | [next] | [standalone]


#328

FromRoger Darlington <rogerarm@freeuk.com>
Date2011-05-22 07:17 +0100
Message-ID<dc053cd751.rogerarm@rogerarm.freeuk.com>
In reply to#327
On 22 May 2011, Rick Murray  wrote:
> On 21/05/2011 14:13, Roger Darlington wrote:

>> But what do you do when the two get out of sync?

> ...work out *why* they are out of sync first. Hacky DST changes throwing
> the filestamps off by an hour?

> I wrote a scanner for Win98, and when I migrated to XP, I was horrified
> to discover that reading the file time stamp using the Win32 API
> actually mucked the times in the switch to summer time. I don't have the
> MSDN data on this machine, but I could have sworn the spec said dates
> were UTC. Evidently not...


>> Delete the lot off the website and re-upload everything??

> If you can nail down a cause, you can work around it.


>> That is 100's of MB's, which may well use up my bandwidth for the
>> month...

> Fair enough. And it's also a total waste of time to upload what hasn't
> changed.


> Can you run PHP? Perhaps a little hidden webpage to scan the directory
> contents and return the name, size, and some sort of checksum?

>    afile.html*49403*4E2F
>    index.html*2856*93A2
>    resources*FOLDER*
>    stuff.html*14059*670A
>    xyzzy.jpeg*93840*819C

> Shouldn't be too hard to do, and on your end you'll arrive at a list of
> files, their size, and a value derived from the file contents.

> Plus, a
> list of folders for subsequent indexing...

There's the bug-bear again. It seems I would have to run this PHP in 
every directory, of which there are hundreds...

But I'm not even sure I can run PHP, I'd have to check first.
> Oh, and in this way, you don't need to log in to anything, just call the
> (hidden) PHP script and record the result.


> Best wishes,

> Rick.


-- 

Cheers
Roger
If you feel weary after just 3 miles, you might be walking too slowly.

[toc] | [prev] | [next] | [standalone]


#329

From"John Williams (News)" <UCEbin@tiscali.co.uk>
Date2011-05-22 09:45 +0200
Message-ID<51d7440c53UCEbin@tiscali.co.uk>
In reply to#328
In article <dc053cd751.rogerarm@rogerarm.freeuk.com>,
   Roger Darlington <rogerarm@freeuk.com> wrote:

> But I'm not even sure I can run PHP, I'd have to check first.

Upload a file with this content:

<?php
phpinfo();
?>

and name it 'phpinfo.php' ('phpinfo/php' under RISC OS).

Calling this 'page' with your browser will either confirm you have PHP
available and tell you lots about it, or do nothing useful at all if you
haven't.

John

-- 
John Williams, Brittany, Northern France - no attachments to these addresses!
Non-RISC OS posters change user to johnrwilliams or put 'risc' in subject!
Who is John Williams? http://petit.four.free.fr/picindex/author/

[toc] | [prev] | [next] | [standalone]


#330

FromSteve Fryatt <news@stevefryatt.org.uk>
Date2011-05-22 10:31 +0100
Message-ID<mpro.lllbrs01bb3q801l7.news@stevefryatt.org.uk>
In reply to#329
On 22 May, John Williams (News) wrote in message
    <51d7440c53UCEbin@tiscali.co.uk>:

> In article <dc053cd751.rogerarm@rogerarm.freeuk.com>,
>    Roger Darlington <rogerarm@freeuk.com> wrote:
> 
> > But I'm not even sure I can run PHP, I'd have to check first.
> 
> Upload a file with this content:
> 
> <?php phpinfo(); ?>
> 
> and name it 'phpinfo.php' ('phpinfo/php' under RISC OS).

Which is missing the point somewhat.  After his original vague request,
Roger has now clarified (a bit) and this appears to be about uploading files
to a site that he has upload (ie. FTP, presumably) access to.  Forget HTTP
with PHP to assist: it's not going to be worth the grief.

On RISC OS, FTPc provides a programmer's API which can be used from
third-party software: it's what SiteMatch does to upload files.  Quickly
skimming the documentation, it provides a "List Directory" command that
returns details of the objects in a folder including Name, Type (File,
Directory or Link) and Size.  You can probably also get the date, but that's
going to be server dependent (and isn't going to be that useful for the
comparison anyway).

Armed with this, the relevant RISC OS OS_GBPB calls, and a little bit of
programming ability, it should be trivial to write what Roger is after.  It
could even upload changed files automatically as it went along, if desired. 
Note that, without storing additional information at the RISC OS end, any
such process (via FTP or HTTP) will miss a file where you change a typo on a
page from (say) "went" to "want" and the overall size doesn't change: that's
one reason why SiteMatch uses the approach that it does.

I'm not aware of anything that already does it on our platform (if anyone
knows differently, I'd be interested), but if you use Linux then tools like
LFTP already have the ability to compare local and remote directories in
this way.

-- 
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/

[toc] | [prev] | [next] | [standalone]


#331

From"John Williams (News)" <UCEbin@tiscali.co.uk>
Date2011-05-22 12:57 +0200
Message-ID<51d755a652UCEbin@tiscali.co.uk>
In reply to#330
In article <mpro.lllbrs01bb3q801l7.news@stevefryatt.org.uk>,
   Steve Fryatt <news@stevefryatt.org.uk> wrote:

> > and name it 'phpinfo.php' ('phpinfo/php' under RISC OS).

> Which is missing the point somewhat.

But might be of use to someone who wants to know if PHP is available to
them, as it's been mentioned here by Rick as a potentially useful tool.

I don't think it's been adequately explained why SiteMatch won't do the job
for Roger, and why he thinks it's the size that matters.

He may be right in how he specifies what he wants, but I can't understand
why that might be so.

> Note that, without storing additional information at the RISC OS end, any
> such process (via FTP or HTTP) will miss a file where you change a typo
> on a page from (say) "went" to "want" and the overall size doesn't
> change: that's one reason why SiteMatch uses the approach that it does.

I agree - the approach of using the datestamp to see if a file is
up-to-date is much more sensible than the size.  And updating only altered
files is the economy that Roger is after for the scale of site he mentions.

John

-- 
John Williams, Brittany, Northern France - no attachments to these addresses!
Non-RISC OS posters change user to johnrwilliams or put 'risc' in subject!
Who is John Williams? http://petit.four.free.fr/picindex/author/

[toc] | [prev] | [next] | [standalone]


#343

FromRick Murray <heyrickmail-usenet@yahoo.co.uk>
Date2011-05-24 01:11 +0200
Message-ID<4ddae992$0$30795$ba4acef3@reader.news.orange.fr>
In reply to#331
On 22/05/2011 12:57, John Williams (News) wrote:

> I agree - the approach of using the datestamp to see if a file is
> up-to-date is much more sensible than the size.

I'd be inclined to favour size and CRC and not bother much with the 
file's date. But then I've had to put up with a load of nonsense 
regarding summer time and the hour offset.

But nothing beats having a check value of some sort derived from file 
contents. That, however, needs smarts on the server. FTP alone won't cut it.


> And updating only altered files is the economy that Roger is after
> for the scale of site he mentions.

Indeed, anything to reduce bandwidth is a good thing.


Best wishes,

Rick.

[toc] | [prev] | [next] | [standalone]


#347

FromAlan Adams <alan@adamshome.org.uk>
Date2011-05-24 17:30 +0100
Message-ID<37c77bd851.Alan.Adams@laptop.adamshome.org.uk>
In reply to#343
In message <4ddae992$0$30795$ba4acef3@reader.news.orange.fr>
          Rick Murray <heyrickmail-usenet@yahoo.co.uk> wrote:

> On 22/05/2011 12:57, John Williams (News) wrote:

>> I agree - the approach of using the datestamp to see if a file is
>> up-to-date is much more sensible than the size.

> I'd be inclined to favour size and CRC and not bother much with the
> file's date. But then I've had to put up with a load of nonsense
> regarding summer time and the hour offset.

> But nothing beats having a check value of some sort derived from file
> contents. That, however, needs smarts on the server. FTP alone won't cut it.

If this is your own site there's another way.

Whenever you have a version of the site ready, calculate the checksums 
of all the files while it's still on your computer. Save these 
checksums.

Then when uploading compare the current checksums with those for the 
files you last uploaded. Any where the checksum differ need to be 
uploaded.

Provided you *always* follow this procedure, you will be OK.

It shouldn't be too difficult to automate this process.

Alternatively, have a look at SafeStore from R-Comp, which I think can 
back up to an FTP service. If so, you upload by backing up, and 
SafeStore does all the hard work.

>> And updating only altered files is the economy that Roger is after
>> for the scale of site he mentions.

> Indeed, anything to reduce bandwidth is a good thing.


> Best wishes,

> Rick.


-- 
Alan Adams, from Northamptonshire
alan@adamshome.org.uk
http://www.nckc.org.uk/

[toc] | [prev] | [next] | [standalone]


#342

FromRick Murray <heyrickmail-usenet@yahoo.co.uk>
Date2011-05-24 01:03 +0200
Message-ID<4ddae7d3$0$30792$ba4acef3@reader.news.orange.fr>
In reply to#330
On 22/05/2011 11:31, Steve Fryatt wrote:

> Forget HTTP with PHP to assist: it's not going to be worth the grief.

;-) I was under the impression that he also wanted to know if the files 
had *changed*. Can you rely upon timestamp and filesize alone?


> You can probably also get the date, but that's going to be server
> dependent (and isn't going to be that useful for the comparison anyway).

So this leaves us with what? Download each file, compare, upload 
replacement if different? That sounds like a lot more grief.

The PHP was specifically mentioned as a way to provide a simple 
algorithmic check on the actual contents of the file, but it a checksum 
or a fully-blown implementation of CRC-32... so long as it is pretty 
quick in operation, and different files give different results (even in 
cases of two dgiits transposed (dgiits -> digits), so it'll need to be 
better than "add up all the ASCII values").


> It could even upload changed files automatically as it went along,

Indeed, but how do you tell what is different to the copy on the *server*?


Best wishes,

Rick.

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.sys.acorn.programmer


csiph-web