Changeset 4442

Show
Ignore:
Timestamp:
01/27/07 15:26:28 (2 years ago)
Author:
morris
Message:

Add wi_file_temporary_path_with_prefix() and wi_file_temporary_path_with_prefix_in_directory()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/libwired/file/wi-file.c

    r4437 r4442  
    123123#pragma mark - 
    124124 
     125wi_string_t * wi_file_temporary_path_with_prefix(wi_string_t *prefix) { 
     126        return wi_file_temporary_path_with_prefix_in_directory(prefix, NULL); 
     127} 
     128 
     129 
     130 
     131wi_string_t * wi_file_temporary_path_with_prefix_in_directory(wi_string_t *prefix, wi_string_t *tmpdir) { 
     132        wi_string_t             *string; 
     133        char                    *path; 
     134         
     135        path = tempnam(tmpdir ? wi_string_cstring(tmpdir) : NULL, wi_string_cstring(prefix)); 
     136        string = wi_string_with_cstring(path); 
     137        free(path); 
     138         
     139        return string; 
     140} 
     141 
     142 
     143 
     144#pragma mark - 
     145 
    125146wi_boolean_t wi_file_delete(wi_string_t *path) { 
    126147        struct stat             sb; 
  • libwired/trunk/libwired/file/wi-file.h

    r4437 r4442  
    7070 
    7171 
     72WI_EXPORT wi_string_t *                         wi_file_temporary_path_with_prefix(wi_string_t *); 
     73WI_EXPORT wi_string_t *                         wi_file_temporary_path_with_prefix_in_directory(wi_string_t *, wi_string_t *); 
     74 
    7275WI_EXPORT wi_boolean_t                          wi_file_delete(wi_string_t *); 
    7376WI_EXPORT wi_boolean_t                          wi_file_clear(wi_string_t *);