POV-Ray : Newsgroups : povray.off-topic : Adventures with digital painting Server Time
14 Nov 2024 18:21:09 EST (-0500)
  Adventures with digital painting (Message 51 to 60 of 197)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Orchid XP v7
Subject: Re: Adventures with digital painting
Date: 8 Mar 2008 14:20:57
Message: <47d2e719$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.

Urg. Anyways...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Adventures with digital painting
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

From: Warp
Subject: Re: Adventures with digital painting
Date: 8 Mar 2008 14:29:58
Message: <47d2e936@news.povray.org>
Orchid XP v7 <voi### [at] devnull> wrote:
> > I love the Unix philosophy of making specific, lightweight tools that 
> > interoperate, rather than gargantuan monolithic beasts that do 
> > everything rather poorly.

> See, now, personally I hate that. It annoys the hell out of me that the 
> Unix way is to use 50,000 tiny tools with all have far too many 
> backwards compatibility modes, bugs and "features".

  He was talking about the unix philosophy, not how this philosophy has
been implemented in some environments.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: Adventures with digital painting
Date: 8 Mar 2008 14:50:20
Message: <47d2edfb@news.povray.org>
Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
> 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.

  Many shellscripts break with file names with spaces in them. This is
because surprisingly few unix geeks know that in shell scripts you have
to use "$@" to refer to all the command-line arguments, not $*.

-- 
                                                          - Warp


Post a reply to this message

From: Darren New
Subject: Re: Adventures with digital painting
Date: 8 Mar 2008 14:54:06
Message: <47d2eede$1@news.povray.org>
Warp wrote:
> Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
>> 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.
> 
>   Many shellscripts break with file names with spaces in them. 

Actually, it's worse. There are surprisingly few utilities that don't 
break on *any* possible file name.

Here's a contest. Given the directory /tmp/stuff, delete all the files 
in that directory that end with ".tmp".

Let's see how many iterations it takes to get actually right.

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Adventures with digital painting
Date: 8 Mar 2008 14:59:54
Message: <47d2f03a@news.povray.org>

> Here's a contest. Given the directory /tmp/stuff, delete all the files 
> in that directory that end with ".tmp".
> 
> Let's see how many iterations it takes to get actually right.

Then I guess rm /tmp/stuff/*.tmp isn't good enough? :)


Post a reply to this message

From: Darren New
Subject: Re: Adventures with digital painting
Date: 8 Mar 2008 15:10:42
Message: <47d2f2c2$1@news.povray.org>
Nicolas Alvarez wrote:

>> Here's a contest. Given the directory /tmp/stuff, delete all the files 
>> in that directory that end with ".tmp".
>>
>> Let's see how many iterations it takes to get actually right.
> 
> Then I guess rm /tmp/stuff/*.tmp isn't good enough? :)

That doesn't even work if there *aren't* funky characters in the file name.

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

From: Warp
Subject: Re: Adventures with digital painting
Date: 8 Mar 2008 15:19:15
Message: <47d2f4c2@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Nicolas Alvarez wrote:

> >> Here's a contest. Given the directory /tmp/stuff, delete all the files 
> >> in that directory that end with ".tmp".
> >>
> >> Let's see how many iterations it takes to get actually right.
> > 
> > Then I guess rm /tmp/stuff/*.tmp isn't good enough? :)

> That doesn't even work if there *aren't* funky characters in the file name.

  It *does* work, assuming you have a sufficiently modern shell (and not
a 20 years old sh). Modern shells are rather smart at escaping what needs
to be escaped when you write "*".

-- 
                                                          - Warp


Post a reply to this message

From: Darren New
Subject: Re: Adventures with digital painting
Date: 8 Mar 2008 15:32:33
Message: <47d2f7e1$1@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Nicolas Alvarez wrote:

>>>> Here's a contest. Given the directory /tmp/stuff, delete all the files 
>>>> in that directory that end with ".tmp".
>>>>
>>>> Let's see how many iterations it takes to get actually right.
>>> Then I guess rm /tmp/stuff/*.tmp isn't good enough? :)
> 
>> That doesn't even work if there *aren't* funky characters in the file name.
> 
>   It *does* work, assuming you have a sufficiently modern shell (and not
> a 20 years old sh). Modern shells are rather smart at escaping what needs
> to be escaped when you write "*".

Bull. Put 300,000 files to be deleted in /tmp/stuff, and watch it bomb.

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

From: Chambers
Subject: Re: Adventures with digital painting
Date: 8 Mar 2008 16:29:54
Message: <47d30552$1@news.povray.org>
Orchid XP v7 wrote:
>> I love the Unix philosophy of making specific, lightweight tools that 
>> interoperate, rather than gargantuan monolithic beasts that do 
>> everything rather poorly.
> 
> See, now, personally I hate that. It annoys the hell out of me that the 
> Unix way is to use 50,000 tiny tools with all have far too many 
> backwards compatibility modes, bugs and "features".

So what you're really saying, is that we need a modern implementation of 
traditional Unix style tools, distributed as a package.  It wouldn't 
need a ton of that backwards-compatibility stuff, because all of the 
included tools are fresh implementations that we know work together.

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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