POV-Ray : Newsgroups : povray.off-topic : Adventures with digital painting : Re: Adventures with digital painting Server Time
14 Nov 2024 20:30:17 EST (-0500)
  Re: Adventures with digital painting  
From: Nicolas Alvarez
Date: 8 Mar 2008 14:24:42
Message: <47d2e7fa$1@news.povray.org>

> Nicolas Alvarez wrote:

>>> ["This makes it read from a file. Unless the file is named '-', in 
>>> which case it reads from stdin." OK, so how do I make it read from a 
>>> file that's actually named '-' then? And other surprising ad-hoc 
>>> behaviours...]
>>
>> ./-
> 
> OK. But it now means that if you write a script that does this, you need 
> to explicitly check whether the file you're going to process just 
> happens to be called "-" and manually escape it if it is. And just 
> think, if you didn't realise that, your script might be used for *years* 
> before somebody tries to use it in that specific way and makes it crash 
> spectacularly.

1. If the file is called -, you're calling for trouble anyway.

2. Whoever passes a filename to your script should be using the ./- thing.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.