Re: fopen() on a network share?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey, look, you can ask PHP what he think about slashes!

var_dump( '\\\\servername\\sharename\\folder\\file.xml' );

I think this should be a different problem

On Tue, Jun 16, 2009 at 10:23 AM, Jan G.B. <ro0ot.w00t@xxxxxxxxxxxxxx>wrote:

> 2009/6/16 Andrew Ballard <aballard@xxxxxxxxx>
>
> > On Mon, Jun 15, 2009 at 7:24 PM, Shawn McKenzie<nospam@xxxxxxxxxxxxx>
> > wrote:
> > > Brian Dunning wrote:
> > >> Extra info, in case needed: my code says
> > >>
> > >> fopen('\\servername\sharename\folder\file.xml', 'w');
> > >>
> > >> and it returns "Failed to open stream, no such file or directory".
> I've
> > >> verified that the PHP machine does have unrestricted permissions to
> that
> > >> share and to the directory. Thanks.
> > >>
> > >>
> > >> On Jun 15, 2009, at 1:39 PM, Brian Dunning wrote:
> > >>
> > >>> Running on Windows... I have a network share, \\sharename\foldername,
> > >>> and I want to write a file. How do I format the pathname with fopen()
> > >>> for this?
> > >>
> > >>
> > >>
> > > As I remember, you either have to double slash or use the other slash.
> > >
> > > \\\\servername\\sharename\\folder\\file.xml
> > >
> > > or
> > >
> > > //servername/sharename/folder/file.xml
> > >
> > > --
> > > Thanks!
> > > -Shawn
> > > http://www.spidean.com
> > >
> >
> > I think '\\\\servername\sharename\folder\file.xml' will work if you're
> > using single quotes around the string. The only slashes that would
> > need escaped are the first two since the first slash in '\\' escapes
> > the second.
> >
> > Andrew
> >
> Guess not, as the backslash after the hostname escapes the next character.
> no matter if it's quoted.
>
>  'this is unterminated, btw \'
>



-- 
Martin Scotta

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux