Changeset 0bf39ed37db37db3d1c925e3af7a742ff251a522
- Timestamp:
- 28/02/07 21:41:01
(2 years ago)
- Author:
- Yoann Peronneau <yoann@videolan.org>
- git-committer:
- Yoann Peronneau <yoann@videolan.org> 1172695261 +0000
- git-parent:
[7815fcbd8eddee11d31daee6663c8937f38771c2]
- git-author:
- Yoann Peronneau <yoann@videolan.org> 1172695261 +0000
- Message:
* src/playlist/loadsave.c: create directory before saving Media Library
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2a347b1d |
r0bf39ed |
|
| 24 | 24 | #include <vlc_playlist.h> |
|---|
| 25 | 25 | #include "playlist_internal.h" |
|---|
| | 26 | #include "misc/configuration.h" |
|---|
| 26 | 27 | #include <vlc_charset.h> |
|---|
| 27 | 28 | |
|---|
| … | … | |
| 119 | 120 | int playlist_MLDump( playlist_t *p_playlist ) |
|---|
| 120 | 121 | { |
|---|
| 121 | | char *psz_uri, *psz_homedir =p_playlist->p_libvlc->psz_homedir; |
|---|
| | 122 | char *psz_uri, *psz_homedir = p_playlist->p_libvlc->psz_homedir; |
|---|
| 122 | 123 | if( !config_GetInt( p_playlist, "media-library") ) return VLC_SUCCESS; |
|---|
| 123 | 124 | if( !psz_homedir ) |
|---|
| 124 | 125 | { |
|---|
| 125 | | msg_Err( p_playlist, "no home directory, cannot load media library") ; |
|---|
| | 126 | msg_Err( p_playlist, "no home directory, cannot save media library") ; |
|---|
| 126 | 127 | return VLC_EGENERIC; |
|---|
| 127 | 128 | } |
|---|
| 128 | | asprintf( &psz_uri, "%s" DIR_SEP CONFIG_DIR DIR_SEP |
|---|
| | 129 | |
|---|
| | 130 | char psz_dirname[ strlen( psz_homedir ) + sizeof( DIR_SEP CONFIG_DIR ) ]; |
|---|
| | 131 | sprintf( psz_dirname, "%s" DIR_SEP CONFIG_DIR, psz_homedir ); |
|---|
| | 132 | if( config_CreateDir( (vlc_object_t *)p_playlist, psz_dirname ) ) |
|---|
| | 133 | { |
|---|
| | 134 | return VLC_EGENERIC; |
|---|
| | 135 | } |
|---|
| | 136 | |
|---|
| | 137 | asprintf( &psz_uri, "%s" DIR_SEP "%s", psz_dirname, |
|---|
| 129 | 138 | "ml.xsp", psz_homedir ); |
|---|
| 130 | 139 | stats_TimerStart( p_playlist, "ML Dump", STATS_TIMER_ML_DUMP ); |
|---|