From owner-freebsd-questions@FreeBSD.ORG Fri Feb 24 04:16:36 2006 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C55416A420 for ; Fri, 24 Feb 2006 04:16:36 +0000 (GMT) (envelope-from jekillen@prodigy.net) Received: from smtp113.sbc.mail.mud.yahoo.com (smtp113.sbc.mail.mud.yahoo.com [68.142.198.212]) by mx1.FreeBSD.org (Postfix) with SMTP id 8891D43D46 for ; Fri, 24 Feb 2006 04:16:35 +0000 (GMT) (envelope-from jekillen@prodigy.net) Received: (qmail 33865 invoked from network); 24 Feb 2006 04:16:35 -0000 Received: from unknown (HELO ?10.0.0.6?) (jekillen@prodigy.net@69.235.10.191 with plain) by smtp113.sbc.mail.mud.yahoo.com with SMTP; 24 Feb 2006 04:16:34 -0000 Mime-Version: 1.0 (Apple Message framework v622) Content-Transfer-Encoding: 7bit Message-Id: <7811c9428278be86b492ad52e3e4f91a@prodigy.net> Content-Type: text/plain; charset=US-ASCII; format=flowed To: questions@freebsd.org From: je killen Date: Thu, 23 Feb 2006 20:16:33 -0800 X-Mailer: Apple Mail (2.622) Cc: Subject: problem with file creation script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2006 04:16:36 -0000 I have a question that has not been answered by the php lists I subscribe to. I have written a script that reads a directory in which I have placed True Type font files for use with gd and php 5.1.2 on FreeBSD v6.0. This is used to generate a text file that serves as input for another script that reads this and calls up each font and writes sample text to a png file. I use touch(.png) in a loop to create corresponding empty png files in a separate directory. The problem is that the server Apache 1.3.34 w/php on FreeBSD has written a ? to the end of the file name: E.G. .png? So the subsequent script that is supposed to actually write to the file fails silently ( no errors, just runs and quits, with nothing written to the files.) I am working with an ftp client from another machine and when I call up the contents of this directory the files are presented as they are supposed to be but if I try to change permissions, the server returns message that the file doesn't exist. I went to the machine and cd'd into the directory and did ls -la and saw the ? on the end of each file name. Could this be written to STANDARD ERROR on the server so not visible via ftp connection? My shell on the FreeBSD machine (the server) is csh. I looked over the actual script and I can't see anything in the script that would have added the question mark. #/*'; # $i++; # }; # fclose($file); # $i = 0; # print(getcwd()."
"); # for($i; $i < count($b); $i++) # { # touch($b[$i]); // this is the line executing touch(), $b is $items in function call below # print $b[$i].'
'; # }; # # } #//gen_img($items); <----- function call #function re_name() # {$a = array(); # $i = 0; # $dir = opendir('ttf_samples') or die("Couldn't open dir named ttf_samples"); # While($a[$i] = readdir($dir)) # {if(ereg('png?', $a[$i])) # { # ereg_replace('png?', 'png', $a[$i]); # } # $i++; # } # } #//re_name(); <-------this would not work #?>(comment chars added to protect the innocent) */ The following is a portion of the out put of ls -la echoed to a txt file, notice the absence of the '?'. -rwx---rwx 1 jekillen wheel 2214 Feb 20 23:27 A-menu.txt -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BRASSETB.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BRASSETO.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BRASSETT.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 Bolton.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BoltonBold.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BoltonBoldItalic.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BoltonDropCaps.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BoltonElongated.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BoltonItalic.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BoltonItalicOutline.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BoltonLight.png -rwx---rwx 1 jekillen wheel 0 Feb 24 02:49 BoltonLightItalic.png I hope this is acceptable for this list. Also I hope this text hasn't been reflowed to bad. I notice that messages I write often show up much differently that the way I originally wrote them. thank you; JK