Enlightenment CVS committal

Author  : chaos
Project : e17
Module  : apps/evfs

Dir     : e17/apps/evfs/src/bin


Modified Files:
        evfs_server_handle.c 


Log Message:
* Fix the mass copy function.  No guarantees as to if this works completely - 
we need unit tests here

===================================================================
RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_server_handle.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- evfs_server_handle.c        15 Aug 2006 12:04:32 -0000      1.67
+++ evfs_server_handle.c        15 Aug 2006 23:32:53 -0000      1.68
@@ -502,9 +502,31 @@
 
                  } else {
                     Ecore_List *directory_list = NULL;
+                    int newlen;
+                    int origlen;
+                    char* pos;
+
+                    evfs_filereference* newdir_rewrite;
+                    
+                    newdir_rewrite = 
evfs_filereference_clone(command->file_command.files[num_files-1]);
+                    if (command == root_command && S_ISDIR(dest_stat.st_mode)) 
{
+                            origlen = strlen(newdir_rewrite->path);
+                            printf("Origlen is: %d (%s)\n", origlen, 
newdir_rewrite->path);
+                            pos = 
strrchr(command->file_command.files[c_file]->path, '/');
+                            printf("String after pos: '%s'\n", pos+1);
+                            newlen = 
strlen(newdir_rewrite->path)+1+strlen(pos+1)+1;
+                            printf("Newlen is: %d\n", newlen);
+                            newdir_rewrite->path = 
realloc(newdir_rewrite->path, newlen);
+                            newdir_rewrite->path[origlen] = '/';
+                            strncat(&newdir_rewrite->path[origlen+1], pos+1, 
strlen(pos)-1);
+                    }
+                    
+
+                    printf("Done: '%s %s'\n",  newdir_rewrite->plugin_uri, 
newdir_rewrite->path);
+                    
+                    
        
-                         evfs_operation_mkdir_task_add(EVFS_OPERATION(op), 
-                              
evfs_filereference_clone(command->file_command.files[num_files-1]));
+                    evfs_operation_mkdir_task_add(EVFS_OPERATION(op), 
newdir_rewrite);
        
                     /*First, we need a directory list... */
                     (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_dir_list) 
(client, command,
@@ -518,23 +540,23 @@
                               evfs_command *recursive_command = 
NEW(evfs_command);
        
                               snprintf(destination_file, PATH_MAX, "%s%s",
-                                       
command->file_command.files[num_files-1]->path,
+                                       newdir_rewrite->path,
                                        strrchr(file->path, '/'));
 
                               source->path = strdup(file->path);
                               source->plugin_uri =
                                  
strdup(command->file_command.files[c_file]->plugin_uri);
                               source->parent = NULL;   /*TODO - handle nested 
uris */
+
                               dest->path = strdup(destination_file);
-                              dest->plugin_uri =
-                                 
strdup(command->file_command.files[num_files-1]->plugin_uri);
+                              dest->plugin_uri = 
strdup(newdir_rewrite->plugin_uri);
                               dest->parent = NULL;     /*TODO - handle nested 
uris */
 
                               recursive_command->file_command.files =
                                  malloc(sizeof(evfs_filereference *) * 2);
                               recursive_command->type = EVFS_CMD_FILE_COPY;
-                              recursive_command->file_command.files[c_file] = 
source;
-                              
recursive_command->file_command.files[num_files-1] = dest;
+                              recursive_command->file_command.files[0] = 
source;
+                              recursive_command->file_command.files[1] = dest;
                               recursive_command->file_command.num_files = 2;
 
                               //printf("Copy file '%s' to %s\n", file->path, 
destination_file);



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to