Paste: First fun program

Author: Checkie
Mode: factor
Date: Tue, 2 Mar 2010 03:04:06
Plain Text |
! Copyright 2010, Checkie.
! License?  We don't need no stinkin' license!
USING: io.directories kernel sequences unicode.case ;
IN: directory-utilities

! directory-files>lower ( pathname -- )
!   Changes filenames to lowercase in directory specified by pathname.
! directory-files>upper ( pathname -- )
!   Changes filenames to uppercase in directory specified by pathname.

: directory-files>case ( pathname >case-quot -- ) swap [ [ dup pick call( old-pathname -- new-pathname ) move-file ] each ] with-directory-files drop ;

: directory-files>lower ( pathname -- ) [ >lower ] directory-files>case ;
: directory-files>upper ( pathname -- ) [ >upper ] directory-files>case ;

Annotation: .

Author: erg
Mode: factor
Date: Tue, 2 Mar 2010 03:31:33
Plain Text |
: each-directory-file ( pathname quot -- )
    '[ [ @ ] each ] with-directory-files ; inline

: directory-files>lower ( pathname -- )
    [ dup >lower move-file ] each-directory-file ;

: directory-files>upper ( pathname -- )
    [ dup >upper move-file ] each-directory-file ;

Annotation: ..

Author: erg
Mode: factor
Date: Tue, 2 Mar 2010 03:35:51
Plain Text |
USING: fry io.directories kernel sequences unicode.case ;
IN: fun

: each-directory-file ( pathname quot -- )
    '[ [ @ ] each ] with-directory-files ; inline

: move-each-directory-file ( pathname quot -- )
    '[ dup @ move-file ] each-directory-file ; inline

: directory-files>lower ( pathname -- )
    [ >lower ] move-each-directory-file ;

: directory-files>upper ( pathname -- )
    [ >upper ] move-each-directory-file ;

Annotation: [ @ ] == _

Author: jon
Mode: factor
Date: Thu, 18 Mar 2010 11:34:37
Plain Text |
: each-directory-file ( pathname quot -- )
    '[ _ each ] with-directory-files ; inline

New Annotation

Summary:
Author:
Mode:
Body: