#7 Add a 'make-directory' procedure

tsx (1)

Currently there is no means for TinyScheme to create a directory within
the filesystem. It would be useful if this functionality were available.

I have attached a patch that adds a 'make-directory' procedure to TinyScheme. The
procedure requires a filename argument, and optionally accepts an additional
'mode' argument. The mode argument is a permissions mask identical to that
specified in the Posix 'mkdir' library function. If the mode argument is not
supplied then it defaults to all available permissions. In both cases, the mode
mask is combined with the process's umask value before applying to the

The procedure returns #t upon successful completion of the operation, otherwise
it returns #f. Possible reasons for failure are that the directory already
exists, the user is not authorized to create it, or that the mode argument was
invalid (i.e., not an integer).

This procedure is similar to the one submitted for GIMP's Script-fu except that this version does not handle UTF8-encoded directory names (doing so would've created a dependency upon GLIB).

1 Attachments


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks