[plt-scheme] Filename-extension bug in hidden dirs?

From: Eli Barzilay (eli at barzilay.org)
Date: Thu May 25 12:13:18 EDT 2006

On May 25, Paulo J. Matos wrote:
> On 25/05/06, Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:
> >
> >
> > On Thu, 25 May 2006, Paulo J. Matos wrote:
> >
> >
> > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > (module fixed-filename-extension mzscheme
> >    (provide filename-extension)
> >    (define filename-extension
> >      (lambda (name)
> >        (unless (path-string? name)
> >          (raise-type-error 'filename-extension "path or string" name))
> >        (let-values ([(base name must-be-dir?)
> >                      (split-path name)])
> >          (and (not must-be-dir?)
> >               (let ([m (regexp-match #rx#"[.]([^.]+)$"
> >                                      (path->bytes name))])
> >                 (and m
> >                      (cadr m))))))))
> > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> >
> >
> 
> Thanks for the code snippet. :)

You can update your .../mzlib directory and you'll get a fixed copy.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.