473,486 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting file timestamp from url

Is is possible to get the timestamp of a file on a web server if it
has a URL?

For example, let's say that I want to know when the following file was
created:

http://www.w3schools.com/xml/note.xml

I can get an HTTPMessage object using urllib2, like this:

-------------------------------------------------------------------
#!/usr/bin/python
import urllib2
url = 'http://www.w3schools.com/xml/note.xml'
f = urllib2.urlopen(url)
finfo = f.info()
-------------------------------------------------------------------

My finfo is an HTTPMessage object, which has getdate() and
getdate_tz() methods. However, they both require a 'name' argument.
I can't figure out what this is...

Am I going down the wrong path? Is there a path I can go down to get
what I want?

Thanks,

Mike

Nov 17 '07 #1
1 5340
"mhearne808[insert-at-sign-here]gmail[insert-dot-here]com"
<mh********@gmail.comwrote:
>
Is is possible to get the timestamp of a file on a web server if it
has a URL?
No, not in the general case.
>For example, let's say that I want to know when the following file was
created:

http://www.w3schools.com/xml/note.xml
Remember that the only information that you get back from the server is the
HTTP request. There is a "Last-Modified" header in the HTTP standards that
says when the page was last modified, and Apache is good about sending it,
but that's all you can find out. Plus, remember that web proxies can
interfere with this.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
6482
by: Joshua Beall | last post by:
Hi All, I am doing some work where I want to do locking, and prevent scripts from running in parallel. I see that I could use the semaphore mechanism, but I'd like for my code to be portable,...
9
1690
by: Adam Monsen | last post by:
I kindly request a code review. If this is not an appropriate place for my request, where might be? Specific questions are in the QUESTIONS section of the code. ...
5
5500
by: David Requena | last post by:
Hi All, I'm trying to parse a file which has some timestamps embedded. These're expressed as a number of seconds elapsed since 01/01/1904 (macintosh time). I know OS X provides some APIs to...
4
2344
by: Mark Harrison | last post by:
So, I'm recording the timestamp from some unix files. Any opinions as to whether it's best to use a "bigint" (which matches the file system data) or a "timestamp" (which might be easier to...
8
2122
by: Daniele Baroncelli | last post by:
How can I get the original datestamp of uploaded files? The array $_FILES doesn't seem to contain the original date. Any solution? Daniele
4
5876
by: sturnfie | last post by:
Hey all, I recently came across the xml.sax libraries and am trying to use them. I am currently making a string variable, and am attempting to pass it into a parser instance as follows: def...
0
1636
by: yogesh_anand | last post by:
Hi I am using sun solaris 5.9 operating system.Sometimes after reading from and while writing to file process size used to get increase.(it can be after 20th times 40 th time) I doesn't happen...
3
1594
by: seb | last post by:
Hi, I am writing to a file some basic information using the logging module. It is working but in the log file some line are printed several time. I had put some print debugging messages in the...
6
2046
by: bill | last post by:
I have been presented with the task of getting the last file from a linux directory when the files are of the form: nnnnnn-xxxxxxx-.ext where nnnnnn are 6 numeric digits and xxxxxx is variable...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5430
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.