mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-09 18:54:04 +02:00
glib/gfileutils.c glib/gfileutils.h glib/glib.symbols Rename g_makepath()
2005-06-22 Tor Lillqvist <tml@novell.com> * glib/gfileutils.c * glib/gfileutils.h * glib/glib.symbols * tests/testglib.c: Rename g_makepath() to g_mkdir_with_parents().
This commit is contained in:
committed by
Tor Lillqvist
parent
f8411a5b97
commit
b8c119f901
@@ -1,3 +1,10 @@
|
|||||||
|
2005-06-22 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* glib/gfileutils.c
|
||||||
|
* glib/gfileutils.h
|
||||||
|
* glib/glib.symbols
|
||||||
|
* tests/testglib.c: Rename g_makepath() to g_mkdir_with_parents().
|
||||||
|
|
||||||
2005-06-22 Matthias Clasen <mclasen@redhat.com>
|
2005-06-22 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/goption.c (parse_short_option, parse_long_option):
|
* glib/goption.c (parse_short_option, parse_long_option):
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
2005-06-22 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* glib/gfileutils.c
|
||||||
|
* glib/gfileutils.h
|
||||||
|
* glib/glib.symbols
|
||||||
|
* tests/testglib.c: Rename g_makepath() to g_mkdir_with_parents().
|
||||||
|
|
||||||
2005-06-22 Matthias Clasen <mclasen@redhat.com>
|
2005-06-22 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/goption.c (parse_short_option, parse_long_option):
|
* glib/goption.c (parse_short_option, parse_long_option):
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
2005-06-22 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* glib/gfileutils.c
|
||||||
|
* glib/gfileutils.h
|
||||||
|
* glib/glib.symbols
|
||||||
|
* tests/testglib.c: Rename g_makepath() to g_mkdir_with_parents().
|
||||||
|
|
||||||
2005-06-22 Matthias Clasen <mclasen@redhat.com>
|
2005-06-22 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/goption.c (parse_short_option, parse_long_option):
|
* glib/goption.c (parse_short_option, parse_long_option):
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
2005-06-22 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* glib/gfileutils.c
|
||||||
|
* glib/gfileutils.h
|
||||||
|
* glib/glib.symbols
|
||||||
|
* tests/testglib.c: Rename g_makepath() to g_mkdir_with_parents().
|
||||||
|
|
||||||
2005-06-22 Matthias Clasen <mclasen@redhat.com>
|
2005-06-22 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/goption.c (parse_short_option, parse_long_option):
|
* glib/goption.c (parse_short_option, parse_long_option):
|
||||||
|
@@ -58,7 +58,7 @@
|
|||||||
#include "galias.h"
|
#include "galias.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_makepath:
|
* g_mkdir_with_parents:
|
||||||
* @pathname: a pathname in the GLib file name encoding
|
* @pathname: a pathname in the GLib file name encoding
|
||||||
* @mode: permissions to use for newly created directories
|
* @mode: permissions to use for newly created directories
|
||||||
*
|
*
|
||||||
@@ -71,8 +71,8 @@
|
|||||||
* Since: 2.8
|
* Since: 2.8
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
g_makepath (const gchar *pathname,
|
g_mkdir_with_parents (const gchar *pathname,
|
||||||
int mode)
|
int mode)
|
||||||
{
|
{
|
||||||
gchar *fn, *p;
|
gchar *fn, *p;
|
||||||
|
|
||||||
|
@@ -107,8 +107,8 @@ gchar *g_build_path (const gchar *separator,
|
|||||||
gchar *g_build_filename (const gchar *first_element,
|
gchar *g_build_filename (const gchar *first_element,
|
||||||
...) G_GNUC_NULL_TERMINATED;
|
...) G_GNUC_NULL_TERMINATED;
|
||||||
|
|
||||||
int g_makepath (const gchar *pathname,
|
int g_mkdir_with_parents (const gchar *pathname,
|
||||||
int mode);
|
int mode);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -260,7 +260,7 @@ g_file_open_tmp PRIVATE
|
|||||||
g_file_test PRIVATE
|
g_file_test PRIVATE
|
||||||
g_file_read_link
|
g_file_read_link
|
||||||
g_mkstemp PRIVATE
|
g_mkstemp PRIVATE
|
||||||
g_makepath
|
g_mkdir_with_parents
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
g_file_get_contents_utf8
|
g_file_get_contents_utf8
|
||||||
g_file_open_tmp_utf8
|
g_file_open_tmp_utf8
|
||||||
|
@@ -320,7 +320,7 @@ find_first_that(gpointer key,
|
|||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
test_g_makepath_1 (const gchar *base)
|
test_g_mkdir_with_parents_1 (const gchar *base)
|
||||||
{
|
{
|
||||||
char *p0 = g_build_filename (base, "fum", NULL);
|
char *p0 = g_build_filename (base, "fum", NULL);
|
||||||
char *p1 = g_build_filename (p0, "tem", NULL);
|
char *p1 = g_build_filename (p0, "tem", NULL);
|
||||||
@@ -333,43 +333,43 @@ test_g_makepath_1 (const gchar *base)
|
|||||||
|
|
||||||
if (g_file_test (p0, G_FILE_TEST_EXISTS))
|
if (g_file_test (p0, G_FILE_TEST_EXISTS))
|
||||||
{
|
{
|
||||||
g_print ("failed, %s exists, cannot test g_makepath\n", p0);
|
g_print ("failed, %s exists, cannot test g_mkdir_with_parents\n", p0);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_file_test (p1, G_FILE_TEST_EXISTS))
|
if (g_file_test (p1, G_FILE_TEST_EXISTS))
|
||||||
{
|
{
|
||||||
g_print ("failed, %s exists, cannot test g_makepath\n", p1);
|
g_print ("failed, %s exists, cannot test g_mkdir_with_parents\n", p1);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_file_test (p2, G_FILE_TEST_EXISTS))
|
if (g_file_test (p2, G_FILE_TEST_EXISTS))
|
||||||
{
|
{
|
||||||
g_print ("failed, %s exists, cannot test g_makepath\n", p2);
|
g_print ("failed, %s exists, cannot test g_mkdir_with_parents\n", p2);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_makepath (p2, 0666) == -1)
|
if (g_mkdir_with_parents (p2, 0666) == -1)
|
||||||
{
|
{
|
||||||
g_print ("failed, g_makepath(%s) failed: %s\n", p2, g_strerror (errno));
|
g_print ("failed, g_mkdir_with_parents(%s) failed: %s\n", p2, g_strerror (errno));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_file_test (p2, G_FILE_TEST_IS_DIR))
|
if (!g_file_test (p2, G_FILE_TEST_IS_DIR))
|
||||||
{
|
{
|
||||||
g_print ("failed, g_makepath(%s) succeeded, but %s is not a directory\n", p2, p2);
|
g_print ("failed, g_mkdir_with_parents(%s) succeeded, but %s is not a directory\n", p2, p2);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_file_test (p1, G_FILE_TEST_IS_DIR))
|
if (!g_file_test (p1, G_FILE_TEST_IS_DIR))
|
||||||
{
|
{
|
||||||
g_print ("failed, g_makepath(%s) succeeded, but %s is not a directory\n", p2, p1);
|
g_print ("failed, g_mkdir_with_parents(%s) succeeded, but %s is not a directory\n", p2, p1);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_file_test (p0, G_FILE_TEST_IS_DIR))
|
if (!g_file_test (p0, G_FILE_TEST_IS_DIR))
|
||||||
{
|
{
|
||||||
g_print ("failed, g_makepath(%s) succeeded, but %s is not a directory\n", p2, p0);
|
g_print ("failed, g_mkdir_with_parents(%s) succeeded, but %s is not a directory\n", p2, p0);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,15 +395,15 @@ test_g_makepath_1 (const gchar *base)
|
|||||||
}
|
}
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
|
||||||
if (g_makepath (p1, 0666) == 0)
|
if (g_mkdir_with_parents (p1, 0666) == 0)
|
||||||
{
|
{
|
||||||
g_print ("failed, g_makepath(%s) succeeded, even if %s is a file\n", p1, p1);
|
g_print ("failed, g_mkdir_with_parents(%s) succeeded, even if %s is a file\n", p1, p1);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_makepath (p2, 0666) == 0)
|
if (g_mkdir_with_parents (p2, 0666) == 0)
|
||||||
{
|
{
|
||||||
g_print ("failed, g_makepath(%s) succeeded, even if %s is a file\n", p2, p1);
|
g_print ("failed, g_mkdir_with_parents(%s) succeeded, even if %s is a file\n", p2, p1);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,18 +415,18 @@ test_g_makepath_1 (const gchar *base)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
test_g_makepath (void)
|
test_g_mkdir_with_parents (void)
|
||||||
{
|
{
|
||||||
g_print ("checking g_makepath()...");
|
g_print ("checking g_mkdir_with_parents()...");
|
||||||
if (!test_g_makepath_1 ("hum"))
|
if (!test_g_mkdir_with_parents_1 ("hum"))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
g_remove ("hum");
|
g_remove ("hum");
|
||||||
if (!test_g_makepath_1 ("hii///haa/hee"))
|
if (!test_g_mkdir_with_parents_1 ("hii///haa/hee"))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
g_remove ("hii/haa/hee");
|
g_remove ("hii/haa/hee");
|
||||||
g_remove ("hii/haa");
|
g_remove ("hii/haa");
|
||||||
g_remove ("hii");
|
g_remove ("hii");
|
||||||
if (!test_g_makepath_1 (g_get_current_dir ()))
|
if (!test_g_mkdir_with_parents_1 (g_get_current_dir ()))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -639,7 +639,7 @@ main (int argc,
|
|||||||
if (n_skip_root_checks)
|
if (n_skip_root_checks)
|
||||||
g_print ("ok\n");
|
g_print ("ok\n");
|
||||||
|
|
||||||
if (test_g_makepath ())
|
if (test_g_mkdir_with_parents ())
|
||||||
g_print ("ok\n");
|
g_print ("ok\n");
|
||||||
|
|
||||||
g_print ("checking doubly linked lists...");
|
g_print ("checking doubly linked lists...");
|
||||||
|
Reference in New Issue
Block a user