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 106160 - Implement a g_mkdir function
Implement a g_mkdir function
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: general
2.2.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2003-02-15 13:52 UTC by Julio Merino
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A simple patch that implements the g_mkdir function (2.02 KB, patch)
2003-02-15 13:52 UTC, Julio Merino
none Details | Review

Description Julio Merino 2003-02-15 13:52:01 UTC
The mkdir(2) function, present in many systems, may be incompatible between them depending on how it is called. For example, calling mkdir(2) with a trailing slash '/' in the path name will fail on NetBSD, while it works in other operating systems (Linux, for example).

GLib should provide an abstraction layer to this function so that programs wanting to create directories do not have to deal with these details. This library can easily implement a g_mkdir() function which parses the filename and then calls the real mkdir function. GLib already provides directory related functions, so adding this one here is a good idea, imho.

This issue could be solved in the operating system's itself, but developers disagree. Solving it in GLib means that even old versions of the operating systems (not fixed) will take advantadge of this feature.

It could also be solved on a program basis, but this makes things harder for developers that don't want to mess with OS specific details.
Comment 1 Julio Merino 2003-02-15 13:52:38 UTC
Created attachment 14348 [details] [review]
A simple patch that implements the g_mkdir function
Comment 2 Owen Taylor 2003-05-22 18:33:23 UTC
I think programs that are calling mkdir() with a trailing
slash are simply broken.

I see nothing in POSIX that would allow it.