Re: [PHP] \n outputs \r\n ??

2003-05-30 Thread Jaap van Ganswijk
At 2003-05-29 11:38 -0700, Michael Isaacs wrote:
>Still new to PHP - any assistance would be very much appreciated...
>
>I am using a php script to send info to a local file for mail filtering.
>Whe the php script sends the following:
>
>fputs($nf, "MAILDIR=$MAILDIR # Default mail directory\n");
>
>the output actually has a chr 13, 10

You're probably running under Windows. Try using fopen('file','wb').
The 'b' stands for 'binary' and it should prevent the expansion
of LF to CRLF. It's mentioned in a note on the manual page of
fopen();


Greetings,
Jaap

-- Chip Directory
-- http://www.chipdir.biz/
-- http://www.chipdir.info/
-- http://www.chipdir.net/
-- http://www.chipdir.nl/
-- http://www.chipdir.org/
-- And about 30 other mirror sites world-wide.
--
-- To subscribe to a free 'chip issues, questions and answers'
-- mailing list, send a message to [EMAIL PROTECTED] with
-- in the body 'subscribe chipdir-L'. About 500 experts are
-- willing to think with you about electronics problems etc.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] \n outputs \r\n ??

2003-05-30 Thread Michael Isaacs
Still new to PHP - any assistance would be very much appreciated...

I am using a php script to send info to a local file for mail filtering.
Whe the php script sends the following:

fputs($nf, "MAILDIR=$MAILDIR # Default mail directory\n");

the output actually has a chr 13, 10

ProcMail interprest the CR as a part of the phrase it is using for parsing,
so when it goes to send a filter out to a folder (testing in my case) it
appends a CR to the end of it, which goofs up the user mail agent.  It also
goofs up the filter itself, as it is looking for a CR in the criteria.

Is there a way to force it to only output a LF, not CRLF?  Configuration
issue?

Michael Isaacs



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php