------=_Part_60506_18925213.1187708869863 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thank you very much for your explanation, it woks correctly indeed.
On 8/19/07, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
The documented specification is file:///d:/CRAN (as specified by RFC1738)=
,
so this is working correctly.
The CHANGES file for 2.2.0 says:
o file:// URLs are now interpreted by download.file(),
download.packages() and url() in the same way as Mozilla-based
browsers. That is, the expected form is
file:///d:/path/to/file
with *three* slashes.
The point is that this is file:// + host + / + path/to/file, and host is
missing. That some versions of IE did not follow the standard is part of
the confusion here.
Note that ?available.packages does say
If a repository is
local, i.e., the URL starts with '"file:"', then the packages are
not downloaded but used directly. (Both '"file:"' and
'"file:///"' are allowed as prefixes to a file path, the latter
for an absolute file path.)
but 'file:' does not work with drives on Windows. That seems clearly to
rule out your usage.
On Fri, 10 Aug 2007, zivan.karaman at gmail.com wrote:
Full_Name: Zivan Karaman Version: 2.5.1 OS: Windows XP SP2 Submission from: (NULL) (195.6.68.214) I think that I have encountered a bug in the function "
available.packages" when
using a local repository (file://=85) on Windows. Version information: platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 5.1 year 2007 month 06 day 27 svn rev 42083 language R version.string R version 2.5.1 (2007-06-27) I have made a copy of the CRAN "/bin/windows/contrib/2.5" directory in
the
"D:/CRAN" folder on my machine.
When I issue the command:
available.packages(contrib.url("file://D:/CRAN"))
I get the follwoing message:
Error in gzfile(file, "r") : unable to open connection
In addition: Warning message:
cannot open compressed file ':/CRAN/bin/windows/contrib/2.5/PACKAGES'
in:
gzfile(file, "r") Looking at the source code, I've spotted the following lines which seem
to cause
trouble:
if (.Platform$OS.type =3D=3D "windows") {
if (length(grep("[A-Za-z]:", tmpf)))
tmpf <- substring(tmpf, 2)
}
Deleting them, the function works OK.
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
------=_Part_60506_18925213.1187708869863 Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline <p class=3D"MsoNormal" style=3D"MARGIN: 0cm 0cm 0pt"><span lang=3D"EN-GB" s= tyle=3D"mso-ansi-language: EN-GB"><font size=3D"2"><font face=3D"Verdana">T= hank you very much for your explanation, it woks correctly indeed.</font></= font></span> </p> <p class=3D"MsoNormal" style=3D"MARGIN: 0cm 0cm 0pt"><span lang=3D"EN-GB" s= tyle=3D"mso-ansi-language: EN-GB"><font size=3D"2"><font face=3D"Verdana">&= nbsp;</font></font></span></p><br><br> <div><span class=3D"gmail_quote">On 8/19/07, <b class=3D"gmail_sendername">= Prof Brian Ripley</b> <<a href=3D"mailto:ripley at stats.ox.ac.uk">ripley at s= tats.ox.ac.uk</a>> wrote:</span> <blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0= px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">The documented specification is = file:///d:/CRAN (as specified by RFC1738),<br>so this is working correctly. <br><br>The CHANGES file for 2.2.0 says:<br><br> o&n= bsp; file:// URLs are now interpreted by download.file(),<br> &n= bsp; download.packages() and url() in th= e same way as Mozilla-based<br> &n= bsp;browsers. That is, the expected form is <br><br> &= nbsp; file:///d:/path/to/file<br><br> &nb= sp; with *three* slashes.<br><br>The point is = that this is file:// + host + / + path/to/file, and host is<br>missing.&nbs= p; That some versions of IE did not follow the standard is part of <br>the confusion here.<br><br>Note that ?available.packages does say<br><b= r> If a repository is<br> l= ocal, i.e., the URL starts with '"file:"', then the packa= ges are<br> not downloaded but used directly. = (Both '"file:"' and <br> '"file:///"' are allowed as = prefixes to a file path, the latter<br> for an abso= lute file path.)<br><br>but 'file:' does not work with drives on Wi= ndows. That seems clearly to<br>rule out your usage. <br><br><br>On Fri, 10 Aug 2007, <a href=3D"mailto:zivan.karaman at gmail.com"=
zivan.karaman at gmail.com</a> wrote:<br><br>> Full_Name: Zivan Karaman<br= > Version: 2.5.1<br>> OS: Windows XP SP2<br>> Submission from: (N=
ULL) ( <a href=3D"http://195.6.68.214">195.6.68.214</a>)<br>><br>><br>> I= think that I have encountered a bug in the function "available.packag= es" when<br>> using a local repository (file://=85) on Windows.<br> ><br>> Version information:<br>> platform &= nbsp; i386-pc-mingw32<br>> arch  = ; i386<br>> os &nbs= p; mingw32<br>> system &n= bsp; i386, mingw32<br>> status<br>> maj= or 2<br>> min= or 5.1<br>> year  = ; 2007<br>> month &= nbsp;06<br>> day &n= bsp; 27<br>> svn rev  = ; 42083<br>> language R<br>>= version.string R version 2.5.1 (2007-06-27)<br>><br>> I have made a = copy of the CRAN "/bin/windows/contrib/2.5" directory in the <br>> "D:/CRAN" folder on my machine.<br>><br>> When I i= ssue the command:<br>><br>> available.packages(contrib.url("file= ://D:/CRAN"))<br>><br>> I get the follwoing message:<br>> Err= or in gzfile(file, "r") : unable to open connection <br>> In addition: Warning message:<br>> cannot open compressed file = ':/CRAN/bin/windows/contrib/2.5/PACKAGES' in:<br>> gzfile(file, = "r")<br>><br>> Looking at the source code, I've spotted= the following lines which seem to cause <br>> trouble:<br>><br>> = if (.Platform$OS.type =3D=3D "windows&qu= ot;) {<br>> &= nbsp; if (length(grep("[A-Za-z]:", t= mpf)))<br>> &= nbsp; tmpf <- substring(tmpf, 2= )<br> >  = ;}<br>> Deleting them, the function works OK.<br>><br>> __________= ____________________________________<br>> <a href=3D"mailto:R-devel at r-pr= oject.org">R-devel at r-project.org</a> mailing list<br>>=20 <a href=3D"https://stat.ethz.ch/mailman/listinfo/r-devel">https://stat.ethz= .ch/mailman/listinfo/r-devel</a><br>><br><br>--<br>Brian D. Ripley, = ; &n= bsp; <a href=3D"mailto:ripley at stats.ox.ac.uk">ripley= @stats.ox.ac.uk </a><br>Professor of Applied Statistics, <a href=3D"http://www.s= tats.ox.ac.uk/~ripley/">http://www.stats.ox.ac.uk/~ripley/</a><br>Universit= y of Oxford, &nb= sp; Tel: +44 1865 272861 (self)<br>1 South Parks Road,&nbs= p; &= nbsp; +44 1865 272866 (PA) <br>Oxford OX1 3TG, UK  = ; Fax: +44 1865 272595<= /blockquote></div><br> ------=_Part_60506_18925213.1187708869863--