Neither "file_test" nor "file.exists" address the OP question, since
both of these depend on the filesystem "stat" call, which doesn't work
via arbitrary remote access protocols such as "http".

Baoqiang Cao: The simplest answer is that if you want the file, try
to download it, and deal with any error you get appropriately.

If you have a particular network protocol that supports it (e.g. ftp) or if the
server is configured appropriately (e.g. http access to the directory)
you are using, you may have a way to obtain a list of existing files.

Henrique Dallazuanna wrote:
Take a look on ?file_test

On Tue, Nov 30, 2010 at 2:10 PM, Baoqiang Cao <bqcaom...@gmail.com> wrote:
Hi,

I'd like to download some data files from a remote server, the problem
here is that some of the files actually don't exist, which I don't
know before try. Just wondering if a function in R could tell me if a
file exists on a remote server? I searched this mailing list and after
read severals mails, still clueless.  Any help will be highly
appreciated.

B.C.

______________________________________________


------------------------------------------------------------------------

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to