gl_confdir = g_strdup( configDir );
- if( mkdir_p( gl_confdir, 0755 ) )
+ if( gtr_mkdir_with_parents( gl_confdir, 0755 ) )
return TRUE;
if( errstr != NULL )
/* ensure the directories are created */
if(( str = pref_string_get( PREF_KEY_DIR_WATCH )))
- mkdir_p( str, 0777 );
+ gtr_mkdir_with_parents( str, 0777 );
if(( str = pref_string_get( TR_PREFS_KEY_DOWNLOAD_DIR )))
- mkdir_p( str, 0777 );
+ gtr_mkdir_with_parents( str, 0777 );
/* initialize the libtransmission session */
session = tr_sessionInit( "gtk", configDir, TRUE, pref_get_all( ) );
* This exemption does not extend to derived works not owned by
* the Transmission project.
*
- * $Id:$
+ * $Id$
*/
#include <ctype.h> /* isxdigit() */
}
int
-mkdir_p( const char * path,
- mode_t mode )
+gtr_mkdir_with_parents( const char * path, int mode )
{
#if GLIB_CHECK_VERSION( 2, 8, 0 )
return !g_mkdir_with_parents( path, mode );
* This exemption does not extend to derived works not owned by
* the Transmission project.
*
- * $Id:$
+ * $Id$
*/
#ifndef GTR_UTIL_H
/* similar to asctime, but is utf8-clean */
char* gtr_localtime2( char * buf, time_t time, size_t buflen );
-/* create a directory and any missing parent directories */
-int mkdir_p( const char *name, mode_t mode );
-
/***
****
***/
/* GTK-related utilities */
#ifdef GTK_MAJOR_VERSION
+/* backwards-compatible wrapper around g_mkdir_with_parents() */
+int gtr_mkdir_with_parents( const char *name, int mode );
+
/* backwards-compatible wrapper around gdk_threads_add_timeout_seconds() */
guint gtr_timeout_add_seconds( guint seconds, GSourceFunc func, gpointer data );