Changeset 4448

Show
Ignore:
Timestamp:
01/28/07 13:46:11 (2 years ago)
Author:
morris
Message:

Update for libwired

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wired/trunk/wired/files.c

    r4443 r4448  
    437437        wi_string_t                     *path; 
    438438        struct stat                     sb; 
    439         wi_boolean_t            result
     439        wi_boolean_t            result = false
    440440         
    441441        realfrompath    = wd_files_real_path(frompath); 
     
    457457 
    458458        if(wi_string_case_insensitive_compare(realfromname, realtoname) == 0) { 
    459                 path = wi_file_temporary_path_with_prefix_in_directory( 
    460                         wi_string_with_format(WI_STR(".%@"), realfromname), 
    461                         wi_string_by_deleting_last_path_component(realfrompath)); 
    462                  
    463                 result = wi_file_rename(realfrompath, path); 
    464                  
    465                 if(result) 
    466                         result = wi_file_rename(path, realtopath); 
     459                path = wi_file_temporary_path_with_template(wi_string_with_format(WI_STR("%@/.%@.XXXXXXXX"), 
     460                                                                                                                                                  wi_string_by_deleting_last_path_component(realfrompath), 
     461                                                                                                                                                  realfromname)); 
     462                 
     463                if(path) { 
     464                        result = wi_file_rename(realfrompath, path); 
     465                 
     466                        if(result) 
     467                                result = wi_file_rename(path, realtopath); 
     468                } 
    467469        } else { 
    468470                if(wi_file_lstat(realtopath, &sb)) {