note 39586 added to function.ftp-fget

From: Date: Tue, 03 Feb 2004 09:29:28 +0000
Subject: note 39586 added to function.ftp-fget
Groups: php.notes 
Request: Send a blank email to php-notes+get-64590@lists.php.net to get a copy of this message
Beware of this: $answerfile = fopen("D:/mydir/txt.txt", "wt"); ftp_fget($conn_id,$answerfile,"txt.txt",FTP_ASCII) Setting the fopen mode to "wt" leads to unexpected behaviour of the ftp_fget function (in my case on a win2000 platform). I was transferring a textfile with 2 lines in it.... in the answerfile the two lines were put behind eachother so no lineending anymore... Instead of setting fopen mode to "wt" just use "w". That fixed the problem. ---- Manual Page -- http://www.php.net/manual/en/function.ftp-fget.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39586 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39586&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39586&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#64590) next »