Stephen Pasco
Stephen Pasco

Reputation: 11

check if content in remote file exists

I have a Python app that needs to check, over HTTP, if text content in a remote file exists. Is there an efficient method to do this check without downloading the entire file? Perhaps reading only the first X bytes or seeing if a word exists within the file? I'm open to all suggestions. Btw, I have to perform this check on numerous files at the same time.

Upvotes: 1

Views: 285

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798774

urlgrabber supports both keepalive (for multiple files on the same server) and ranges (for reading from the middle of a file). Both features are dependent on server support though.

Upvotes: 4

Related Questions