Re: New Extension Proposal: FileConv
| From: | Ilia Alshanetsky | Date: | Fri, 02 Jan 2009 21:54:53 +0000 |
| Subject: | Re: New Extension Proposal: FileConv | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-6032@lists.php.net to get a copy of this message | ||
I could be helpful to add the mac variants while you are at it.
On 2-Jan-09, at 3:50 PM, Daniel Brown wrote:
Happy new year, all! I've got an extension that I've been using on my side that I thought may be of benefit to the community as a PECL extension. I've been referring to it as "FileConv" in my notes, but the name could probably use a polish. The package consists of two very simple functions:Ilia Alshanetsky* dos2unix() * unix2dos()It extends PHP to use these functions natively to do the same as their *NIX counterparts: the simple act of changing newlines to and from DOS/UNIX formats. The added benefit is that it does so without changing the timestamp on the file. The hash of the file would, of course, be changed, but that's expected. NOTE: As of now, this has *only* been tested on Linux. I'll freely admit that I am not very proficient in Windows-specific programming, especially in C. From the simple README I threw together: ==== FileConv Extension for PHP by Daniel P. Brown danbrown@php.net|| daniel.brown@parasane.net http://www.parasane.net/ ABOUTVersion 1.0FileConv contains the following PHP functions: * dos2unix() - Converts files from UNIX format to DOS format. * unix2dos() - Converts files from DOS format to UNIX format.BASIC MANPAGE DESCRIPTIONbool dos2unix( string $filename ) Converts $filename to UNIX format and returns TRUE on success,FALSE on failure. TESTINGOnce installed, you can test this application simply by running: /bin/env php fileconv-test.php==== If this sounds alright, then I'll go through the application process. If it sucks, then I'll just keep my mouth shut and use (and distribute) it myself. --</Daniel P. Brown> daniel.brown@parasane.net || danbrown@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out! --PECL development discussion Mailing List (http://pecl.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php