script-fu, string parsing

script-fu, string parsing

Post by Andreas V. Oppenhei » Thu, 20 Feb 2003 01:50:04



Hi, did anybody know how i get the filename of a whole string, for eg. of
"/home/andreas/test.png" i want get the "test.png"

Thanks for help

 
 
 

script-fu, string parsing

Post by Branko Colli » Thu, 20 Feb 2003 07:10:43



17:50:04 +0100:

Quote:>Hi, did anybody know how i get the filename of a whole string, for eg. of
>"/home/andreas/test.png" i want get the "test.png"

According to the SIOD documentation, (strbreakup
"/home/andreas/test.png" "/") should return the list ("home" "andreas"
"test.png").

I don't know if there is an easy way to get to the tail of that list.

--
branko collin
    "I won't say anything because no one ever listens to
    me. I might as well be a Leonard Cohen record."
                 - Neil, of The Young Ones

 
 
 

script-fu, string parsing

Post by Geoffrey Summerhaye » Thu, 20 Feb 2003 13:22:40




> 17:50:04 +0100:

> >Hi, did anybody know how i get the filename of a whole string, for eg. of
> >"/home/andreas/test.png" i want get the "test.png"

> According to the SIOD documentation, (strbreakup
> "/home/andreas/test.png" "/") should return the list ("home" "andreas"
> "test.png").

> I don't know if there is an easy way to get to the tail of that list.

(define (path->filename x)
  (car (last (strbreakup x "/"))))
 
 
 

1. Script-Fu from Perl-Fu non-interactively

Hi all,

Is there a way yet to call Script-Fu from Perl-Fu non-interactively. I
am tempted to learn Scheme, but I would really prefer Perl. I am
using Gimp 1.04

Best regards,
Chris

Sent via Deja.com http://www.deja.com/
Before you buy.

2. HELP! GIF format: End code

3. Parsing, parsing, not parsing

4. CHAPEL.BMP (09/22) "Chapel image"

5. Gimp 1.2.3 - Script-Fu freezing

6. 1 gig sticks at the right price

7. Script-fu buttons

8. msp6

9. finding function name for script-fu

10. Help Problem PERL-Fu script logo creation

11. Script-fu Group

12. script-fu, pupi-button and dynamic text

13. novice question--script-fu in batch mode parameter problem