[phc-general] found 2 problems.

Paul Biggar paul.biggar at gmail.com
Tue Oct 16 01:17:08 CEST 2007


On 10/15/07, Edsko de Vries <edsko at phpcompiler.org> wrote:
> > 2. Running this command (where output and input are the same)
> > results in an empty file, I understand that I should not be normally
> > doing this, but maybe it useful to warn the user that it's dangerous.
> >
> > /home/download/phc/src/phc --no-leading-tab --pretty-print photoalbums.php > photoalbums.php
> >
> Both ideas are good ideas. At the moment, any file written by phc gets overwritten without any warning whatsoever. It may be good to add a --backup option.


Now, my impression was the bash cleared the file into which output was
redirected with >. As such, the file is cleared before we even read
it. So, I dont think it's possible to back it up. Is this not the
case?

If so, and I think it is, then neither warning the user, nor having a
--backup option, are useful.


Paul

-- 
Paul Biggar
paul.biggar at gmail.com


More information about the phc-general mailing list