Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : apps/evfs

Dir     : e17/apps/evfs/src/plugins


Modified Files:
        evfs_fs_posix.c evfs_fs_samba.c 


Log Message:
* TODO++
* Make recursive directory removal work on evfs_fs_SMB

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/plugins/evfs_fs_posix.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- evfs_fs_posix.c     28 Dec 2005 11:35:19 -0000      1.26
+++ evfs_fs_posix.c     1 Jan 2006 04:21:52 -0000       1.27
@@ -435,7 +435,7 @@
        
        dir = opendir(command->file_command.files[0]->path);
        while ( (de = readdir(dir)) ) {
-               if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..") && 
de->d_name[0] != '.') {
+               if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..") && 
strcmp(de->d_name, ".")) {
                        evfs_filereference* ref = NEW(evfs_filereference);
                        
                        snprintf(full_name, 1024, "%s/%s", 
command->file_command.files[0]->path, de->d_name);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/plugins/evfs_fs_samba.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- evfs_fs_samba.c     27 Dec 2005 11:44:37 -0000      1.24
+++ evfs_fs_samba.c     1 Jan 2006 04:21:52 -0000       1.25
@@ -60,7 +60,7 @@
 int evfs_file_write(evfs_filereference* file, char* bytes, long size);
 int evfs_file_create(evfs_filereference* file);
 int smb_evfs_file_mkdir(evfs_filereference* file);
-
+int evfs_file_remove(char* file);
 
 
 
@@ -127,7 +127,7 @@
             char *password, int pwmaxlen)
 {
   char temp[128];
-  char path[512];
+  char path[PATH_MAX];
   evfs_auth_cache* obj;
 
   fprintf(stdout, "Need password for //%s/%s\n", server, share);
@@ -184,7 +184,12 @@
        functions->evfs_file_write = &evfs_file_write;
        functions->evfs_file_create = &evfs_file_create;
        functions->evfs_file_stat = &smb_evfs_file_stat;
+       functions->evfs_file_lstat = &smb_evfs_file_stat;   /*Windows file 
systems have no concept
+                                                             of 'lstat'*/
+
+       
        functions->evfs_file_mkdir = &smb_evfs_file_mkdir;
+       functions->evfs_file_remove = &evfs_file_remove;
        printf("Samba stat func at '%p'\n", &smb_evfs_file_stat);
 
        auth_cache = ecore_list_new();
@@ -217,7 +222,7 @@
        
        int err = 0;
        int fd = 0;
-       char dir[128];
+       char dir[PATH_MAX];
        static struct stat smb_stat;
 
        //struct stat* file_stat = calloc(1,sizeof(struct stat));
@@ -228,7 +233,7 @@
 
        err = smb_context->stat(smb_context, (const char*)dir, &smb_stat);
        printf("Returned error code: %d\n", err);
-       printf("File size: %d\n", file_stat->st_size);
+       printf("File size: %ld\n", file_stat->st_size);
        
        printf("Returning to caller..\n");
 
@@ -260,7 +265,7 @@
 Ecore_List** directory_list
 ) {
        
-       char dir_path[1024];
+       char dir_path[PATH_MAX];
 
        int fd, dh1, dh2, dh3, dsize, dirc;
        int size;
@@ -339,6 +344,30 @@
        return file->fd;
 }
 
+int evfs_file_remove(char* file) {
+       char file_smb[PATH_MAX];
+       static struct stat file_stat;
+
+       snprintf (file_smb, PATH_MAX, "smb:/%s", file);
+       
+
+       int rr = smb_context->stat(smb_context, (const char*)file_smb, 
&file_stat);
+       if (!rr) {
+               /*File stat successful*/
+               if (S_ISDIR(file_stat.st_mode)) {
+                       printf("Rmdiring '%s'\n", file_smb);
+                       return smb_context->rmdir(smb_context, file_smb);       
        
+               } else {
+                       printf("Unlinking '%s'\n", file_smb);
+                       return smb_context->unlink(smb_context, file_smb);
+               }
+       } else {
+               printf ("Could not stat '%s'\n", file_smb);
+       }
+       
+       
+}
+
 int evfs_file_close(evfs_filereference* file) {
        printf ("SMB close: closing\n");
 




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to