FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Command line cannot fwrite, browser can
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Command line cannot fwrite, browser can [message #174629 is a reply to message #174611] Thu, 23 June 2011 03:44 Go to previous messageGo to previous message
Adrienne Boswell is currently offline  Adrienne Boswell
Messages: 25
Registered: October 2010
Karma:
Junior Member
Thomas 'PointedEars' Lahn <PointedEars(at)web(dot)de> wrote at
news:8855064(dot)SEqChMirdb(at)PointedEars(dot)de:

> Adrienne Boswell wrote:
>
>> Jerry Stuckle writing:
>>> On 6/18/2011 4:05 AM, Adrienne Boswell wrote:
>>>> Thomas 'PointedEars' Lahn writing:
>>>> >> $groupmail = fopen( $filename,'w' ) or die( 'cannot open
>>>> >> groupmail.html' );
>>>> >
>>>> > <http://www.phpfreaks.com/blog/or-die-must-die>
>>>>
>>>> Thank you for all your help, and the link. I have read it and will
>>>> implement it.
>>>
>>> I think you have another problem. Single vs. double quotes would
>>> not make any difference in the code you posted.
>>
>> Originally, I was not using an absolute path, just the name of the
>> file, and the script was saying the last file was not found, and
>> could not write to the first file.
>>
>> Then, I tried using the whole path, and I got a message about an
>> invalid stream, and I Googled and found a post about single quotes vs
>> double quotes, tried it, and it worked.
>
> Jerry is correct: Single quotes vs. double quotes make absolutely no
> difference in the code that you have posted, since there are no
> variable references in or adjacent to the string values. Without loss
> of generality, they also make no difference when enclosing file paths,
> unless the paths contain the delimiter character (in which case the
> string value would end prematurely, which might contribute to the fact
> that a file could not be found).
>
>> Yes, this is nagging me, too. I just checked it ran it right now (I
>> also moved the script so it is not accessible to the WWW),
>
> This is not the World Wide Web, an application of the Internet, but
> Usenet, a part of the Network News network (a growing part of which is
> part of the Internet). So you may – SHOULD – as well post the
> *relevant* *parts* of your working code here.


Ok, here is the relavent piece of code (the relavent parts were snipped by
Jerry).

Originally (with line numbers and I have replaced the real domain with
example.com):

68 $filename = "C:\Inetpub\vhosts\example.com\httpdocs\groupmail
\groupmail.html";

80 $groupmail = fopen( $filename,'w' ) or die( 'cannot open
groupmail.html' );


Warning: fopen(C:\Inetpub?hosts\example.com\httpdocs\groupmail\groupmail.ht
ml): failed to open stream: Invalid argument in C:\Inetpub\vhosts
\example.com\httpdocs\groupmail.php on line 80
cannot open groupmail.html


So when I changed line 68 to:

68 $filename = 'C:\Inetpub\vhosts\example.com\httpdocs\groupmail
\groupmail.html';


>
>> and it's doing just fine. So far so good. I'm letting sleeping dogs
>> lie, for now.
>
> So, without evidence to the contrary, one must assume that you have
> not understood what you are doing in the first place,

Actually, I do understand what I did, and wrote the script to perform what
I expected it to do. On my developer box, Windows 7 Ultimate IIS 6, the
original script ran flawlessly. It was not until I put it on the virtual
host box that it started acting badly.

that you are not
> willing to understand the problems that this has caused you in the
> foreseeable future,

That's why I'm here - to gain insight into what could bite me in the ass in
the future.

and that you are not willing to feed back the
> insights you have gained from other code to the community that tried
> to help you for free.

I beg to differ with you there. I may not contribute much to this
particular group, I am mostly a lurker here, but I do contribute often to
the HTML groups, and when they were alive the ASP classic groups.

>
> That puts into serious doubt whether you are worth getting further,
> rather time-consuming, answers like the ones I give to you. Think
> about that.

One of the reasons I came here was because I have high respect for your
knowledge. You might think that because I'm girl I have thin skin, but I
don't. I have been around Usenet since 1996, so I have seen a lot,
including your latest run-in with Jukka Korpela.


>
> And skip the attribution novels, please.
>
>
> PointedEars



--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: pagination driving me insane
Next Topic: insert query error
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 07:37:51 GMT 2024

Total time taken to generate the page: 0.04209 seconds