After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725626 - Add procedure for creating directories
Add procedure for creating directories
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: Script-Fu
git master
Other All
: Normal enhancement
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2014-03-03 23:27 UTC by saulgoode
Modified: 2018-05-24 14:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add make-directory procedure (3.60 KB, patch)
2014-03-03 23:27 UTC, saulgoode
needs-work Details | Review

Description saulgoode 2014-03-03 23:27:46 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).
Comment 1 Kevin Cozens 2015-06-09 02:45:57 UTC
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 2 Michael Schumacher 2016-05-28 20:37:24 UTC
Comment on attachment 270855 [details] [review]
Add make-directory procedure

See comment 1
Comment 3 Michael Schumacher 2016-06-22 13:00:05 UTC
Seems that we should be able to decide this rather fast, if we want to.
Comment 4 GNOME Infrastructure Team 2018-05-24 14:21:01 UTC
-- 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.