File Exchange

image thumbnail

Rewrites of urlread and urlwrite

version 1.0.0.0 (5.06 KB) by Fu-Sung Wang
Adding TIMEOUT to both url functions.

0 Downloads

Updated 15 Sep 2005

No License

Two days ago, on MATLAB Newsgroup, I found Greggory asking something about "urlread" which is lack of TIMEOUT capability. And such a deficiency often leads to an embarrassing and horriable situation that main function gets freezed easily when the network is busy or abnormal.

At the beginning, I tried to follow the asker by using a timer, but it failed finally. The reason I thought is that timer can not interrupt the
task being busy at all and yet MATLAB doesn't have a scheme for using multi-threads so far. Fortunately, I discovered another hope that a part of urlread is written in JAVA. So I tried to modify the urlread function by adding a "timeout" parameter, enabling it to automatically stop the request at a time the user specified.

Comments and Ratings (3)

Serge

The examples in urlread2 and urlwrite2 refer to urlread (no 2). Even after rename examples don't work because a default value for timeout is not set.

Dimitri Shvorob

..Following up on Christian's comment, has TMW done so?

Christian Schwarzbauer

A very useful modification of the original Matlab functions urlread.m and urlwrite.m! I hope Matlab will include it in their next release.

Updates

1.0.0.0

It isn't optimised, so let me know if there is any bug.

MATLAB Release Compatibility
Created with R14SP2
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: urlread2

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor