GNOME Bugzilla – Bug 725626
Add procedure for creating directories
Last modified: 2018-05-24 14:21:01 UTC
Created attachment 270855 [details] [review] Add make-directory procedure Currently there is no means for Script-fu scripts to create a directory within the filesystem. It would be useful if this functionality were available. I have added a patch that adds a 'make-directory' procedure to Script-fu. 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 directory. The procedure return #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). The name 'make-directory' was chosen as it appears in the majority of Scheme implementations and is consistent with the naming conventions of other procedures in Script-fu. The name 'make-directory' is currently used by Bigloo, MzScheme, Gambit, MIT, and Racket. There are some other names used for this functionality but they are (in my opinion) less suitable for Script-fu ('mkdir' is used by Guile Scheme, 'ch-mk-dir' is used by Chez Scheme, and 'create-pathname-directory' is used by Chicken Scheme).
I would suggest something like dir-create or dir-make as the other directory related functions start with "dir-". If there is a desire to harmonize the file and directory operations against other Scheme implementations the existing ones could be deprecated and in favour of new names for the operations.
Comment on attachment 270855 [details] [review] Add make-directory procedure See comment 1
Seems that we should be able to decide this rather fast, if we want to.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/541.