Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : apps/evfs

Dir     : e17/apps/evfs/src/plugins


Modified Files:
        evfs_fs_posix.c 


Log Message:
File renaming support

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/plugins/evfs_fs_posix.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- evfs_fs_posix.c     17 Sep 2005 06:54:20 -0000      1.8
+++ evfs_fs_posix.c     26 Sep 2005 11:39:47 -0000      1.9
@@ -42,6 +42,7 @@
 
 /*Main file wrappers*/
 int evfs_file_remove(char* src);
+int evfs_file_rename(char* src, char* dst);
 int evfs_monitor_start(evfs_client* client, evfs_command* command);
 int evfs_monitor_stop(evfs_client* client, evfs_command* command);
 
@@ -238,9 +239,6 @@
        struct stat* stat_src;
        int i;
 
-       
-       
-
        if (!stat(src, stat_src)) {
                return file_remove(src, stat_src);
        } else {
@@ -250,6 +248,12 @@
 }
 
 
+int evfs_file_rename(char* src, char* dst) {
+       printf("Renaming %s to %s\n", src,dst);
+       return evfs_misc_rename(src,dst);       
+}
+
+
 
 
 
@@ -587,12 +591,12 @@
 
   D("Moving file %s to %s\n", src_path, dst_path);
 
-  /* Metadata is handled both in efsd_misc_rename()
+  /* Metadata is handled both in evfs_misc_rename()
      and file_copy().
   */
 
   /* Try simple rename ... */
-  if (!efsd_misc_rename(src_path, dst_path))
+  if (!evfs_misc_rename(src_path, dst_path))
     {
       D("Rename failed -- copying %s to %s, then removing.\n", src_path, 
dst_path);
       if (file_copy(src_path, src_st, dst_path))
@@ -674,7 +678,7 @@
          goto error_exit;
        }
       
-      if (efsd_misc_rename(src, dst))
+      if (evfs_misc_rename(src, dst))
        continue;
       
       if (S_ISDIR(src_st.st_mode))
@@ -1039,7 +1043,7 @@
       D("Trying simple rename() from %s to %s ...\n",
        src_path, dst_path);
 
-      if (!efsd_misc_rename(src_path, dst_path))
+      if (!evfs_misc_rename(src_path, dst_path))
        {
          int success;
          
@@ -1157,3 +1161,29 @@
   D_RETURN_(FALSE);
 }
 
+int    
+evfs_misc_rename(char *file1, char *file2)
+{
+  D_ENTER;
+
+  if (!file1 || file1[0] == '\0' ||
+      !file2 || file2[0] == '\0')
+    {
+      errno = EINVAL;
+      D_RETURN_(FALSE);
+    }
+
+  if (rename(file1, file2) == 0)
+    {
+      /* Update stat cache to new name ... */
+      //efsd_stat_change_filename(file1, file2);
+
+      /* ... and metadata. */
+      //efsd_meta_move_data(file1, file2);
+
+      D_RETURN_(TRUE);
+    }
+  
+  D_RETURN_(FALSE);
+}
+




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to