Split (vfs|directory|file) to &, &_parent and &_slave by inheritance.
[captive.git] / src / libcaptive / sandbox / parent-File.c
1 /* $Id$
2  * CORBA/ORBit client side of File object of sandbox_parent()
3  * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; exactly version 2 of June 1991 is required
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19
20 #include "config.h"
21
22 #include "parent-File.h"        /* self */
23 #include <glib/gmessages.h>
24 #include "split.h"
25 #include "sandbox.h"
26 #include "../client/file.h"
27 #include "../client/vfs.h"
28 #include "FileInfo.h"
29 #include "captive/macros.h"
30 #include "reactos/ntos/types.h" /* for ULONG */
31
32
33 GnomeVFSResult captive_sandbox_parent_file_new_open(CaptiveFileParentObject *captive_file_parent_object,
34                 const gchar *pathname,GnomeVFSOpenMode mode)
35 {
36 xmlNode *xml_action=NULL;
37 CaptiveVfsParentObject *captive_vfs_parent_object;
38
39         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
40         g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
41
42         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
43
44         if (captive_vfs_parent_object->corba_bug_action) {
45                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_new_open",NULL);
46                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
47                 xmlNewProp(xml_action,"pathname",pathname);
48                 xmlNewProp(xml_action,"mode",captive_printf_alloca("%u",(unsigned)mode));
49                 }
50
51         captive_file_parent_object->corba_File_object=Captive_Vfs_file_new_open(
52                         captive_vfs_parent_object->corba_Vfs_object,pathname,mode,&captive_corba_ev);
53         if (xml_action)
54                 xmlNewProp(xml_action,"result",(captive_corba_ev._major==CORBA_NO_EXCEPTION ? "1" : "0"));
55
56         return captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
57 }
58
59
60 GnomeVFSResult captive_sandbox_parent_file_new_create(CaptiveFileParentObject *captive_file_parent_object,
61                 const gchar *pathname,GnomeVFSOpenMode mode,gboolean exclusive,guint perm)
62 {
63 xmlNode *xml_action=NULL;
64 CaptiveVfsParentObject *captive_vfs_parent_object;
65
66         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
67         g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
68
69         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
70
71         if (captive_vfs_parent_object->corba_bug_action) {
72                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_new_create",NULL);
73                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
74                 xmlNewProp(xml_action,"pathname",pathname);
75                 xmlNewProp(xml_action,"mode",captive_printf_alloca("%u",(unsigned)mode));
76                 xmlNewProp(xml_action,"exclusive",captive_printf_alloca("%u",(unsigned)exclusive));
77                 xmlNewProp(xml_action,"perm",captive_printf_alloca("%u",(unsigned)perm));
78                 }
79
80         captive_file_parent_object->corba_File_object=Captive_Vfs_file_new_create(
81                         captive_vfs_parent_object->corba_Vfs_object,pathname,mode,exclusive,perm,&captive_corba_ev);
82         if (xml_action)
83                 xmlNewProp(xml_action,"result",(captive_corba_ev._major==CORBA_NO_EXCEPTION ? "1" : "0"));
84
85         return captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
86 }
87
88
89 GnomeVFSResult captive_sandbox_parent_file_close(CaptiveFileParentObject *captive_file_parent_object)
90 {
91 GnomeVFSResult r;
92 xmlNode *xml_action=NULL;
93 CaptiveVfsParentObject *captive_vfs_parent_object;
94
95         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
96
97         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
98
99         if (captive_vfs_parent_object->corba_bug_action) {
100                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_close",NULL);
101                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
102                 }
103
104         Captive_File_shutdown(captive_file_parent_object->corba_File_object,&captive_corba_ev);
105         r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
106         if (xml_action)
107                 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
108         if (r!=GNOME_VFS_OK)
109                 return r;
110
111         CORBA_Object_release((CORBA_Object)captive_file_parent_object->corba_File_object,&captive_corba_ev);
112         captive_file_parent_object->corba_File_object=CORBA_OBJECT_NIL;
113
114         return captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
115 }
116
117
118 GnomeVFSResult captive_sandbox_parent_file_read(CaptiveFileParentObject *captive_file_parent_object,
119                 gpointer buffer_captive,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return)
120 {
121 GnomeVFSResult r;
122 Captive_Bytes *buffer_corba;
123 xmlNode *xml_action=NULL;
124 CaptiveVfsParentObject *captive_vfs_parent_object;
125
126         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
127         g_return_val_if_fail(buffer_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
128         g_return_val_if_fail(bytes_read_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
129         g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS);
130
131         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
132
133         *bytes_read_return=0;
134
135         if (captive_vfs_parent_object->corba_bug_action) {
136                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_read",NULL);
137                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
138                 xmlNewProp(xml_action,"num_bytes",captive_printf_alloca("%lu",(unsigned long)num_bytes));
139                 }
140
141         Captive_File_read(captive_file_parent_object->corba_File_object,&buffer_corba,num_bytes,&captive_corba_ev);
142         r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
143         if (xml_action)
144                 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
145         if (r!=GNOME_VFS_OK)
146                 return r;
147
148         g_return_val_if_fail(buffer_corba->_length<=num_bytes,GNOME_VFS_ERROR_GENERIC);
149         memcpy(buffer_captive,buffer_corba->_buffer,buffer_corba->_length);
150         *bytes_read_return=buffer_corba->_length;
151
152         Captive_Bytes__freekids(buffer_corba,NULL/* 'd'; meaning? */);
153         CORBA_free(buffer_corba);
154
155         if (xml_action)
156                 xmlNewProp(xml_action,"bytes_read_return",captive_printf_alloca("%lu",(unsigned long)*bytes_read_return));
157
158         return GNOME_VFS_OK;
159 }
160
161
162 GnomeVFSResult captive_sandbox_parent_file_write(CaptiveFileParentObject *captive_file_parent_object,
163                 gconstpointer buffer_captive,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return)
164 {
165 GnomeVFSResult r;
166 Captive_Bytes buffer_corba_local;
167 Captive_GnomeVFSFileSize bytes_written_corba;
168 xmlNode *xml_action=NULL;
169 CaptiveVfsParentObject *captive_vfs_parent_object;
170
171         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
172         g_return_val_if_fail(buffer_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
173         g_return_val_if_fail(bytes_written_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
174         g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS);
175
176         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
177
178         *bytes_written_return=0;
179
180         if (captive_vfs_parent_object->corba_bug_action) {
181                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_write",NULL);
182                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
183                 xmlNewProp(xml_action,"num_bytes",captive_printf_alloca("%lu",(unsigned long)num_bytes));
184                 }
185
186         buffer_corba_local._maximum=num_bytes;
187         buffer_corba_local._length=num_bytes;
188         buffer_corba_local._buffer=(/* de-const */gpointer)buffer_captive;
189         buffer_corba_local._release=FALSE;
190
191         Captive_File_write(captive_file_parent_object->corba_File_object,&buffer_corba_local,&bytes_written_corba,&captive_corba_ev);
192         r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
193         if (xml_action)
194                 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
195         if (r!=GNOME_VFS_OK)
196                 return r;
197
198         *bytes_written_return=bytes_written_corba;
199
200         if (xml_action)
201                 xmlNewProp(xml_action,"bytes_written_return",captive_printf_alloca("%lu",(unsigned long)*bytes_written_return));
202
203         return GNOME_VFS_OK;
204 }
205
206
207 GnomeVFSResult captive_sandbox_parent_file_seek
208                 (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset)
209 {
210 GnomeVFSResult r;
211 xmlNode *xml_action=NULL;
212 CaptiveVfsParentObject *captive_vfs_parent_object;
213
214         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
215
216         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
217
218         if (captive_vfs_parent_object->corba_bug_action) {
219                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_seek",NULL);
220                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
221                 xmlNewProp(xml_action,"whence",
222                                 (whence==GNOME_VFS_SEEK_START ? "start" :
223                                         (whence==GNOME_VFS_SEEK_CURRENT ? "current" :
224                                                 (whence==GNOME_VFS_SEEK_END ? "end" : captive_printf_alloca("%lu",(unsigned long)whence)))));
225                 xmlNewProp(xml_action,"offset",captive_printf_alloca("%" G_GINT64_FORMAT,(gint64)offset));
226                 }
227
228         Captive_File_seek(captive_file_parent_object->corba_File_object,whence,offset,&captive_corba_ev);
229         r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
230         if (xml_action)
231                 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
232         if (r!=GNOME_VFS_OK)
233                 return r;
234
235         return GNOME_VFS_OK;
236 }
237
238
239 GnomeVFSResult captive_sandbox_parent_file_tell(CaptiveFileParentObject *captive_file_parent_object,GnomeVFSFileOffset *offset_return)
240 {
241 Captive_GnomeVFSFileOffset offset_corba;
242 GnomeVFSResult r;
243 xmlNode *xml_action=NULL;
244 CaptiveVfsParentObject *captive_vfs_parent_object;
245
246         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
247         g_return_val_if_fail(offset_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
248
249         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
250
251         if (captive_vfs_parent_object->corba_bug_action) {
252                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_tell",NULL);
253                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
254                 }
255
256         Captive_File_tell(captive_file_parent_object->corba_File_object,&offset_corba,&captive_corba_ev);
257         r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
258         if (xml_action)
259                 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
260         if (r!=GNOME_VFS_OK)
261                 return r;
262
263         *offset_return=offset_corba;
264
265         if (xml_action)
266                 xmlNewProp(xml_action,"offset_return",captive_printf_alloca("%" G_GINT64_FORMAT,(gint64)*offset_return));
267
268         return GNOME_VFS_OK;
269 }
270
271
272 GnomeVFSResult captive_sandbox_parent_file_remove(CaptiveFileParentObject *captive_file_parent_object)
273 {
274 GnomeVFSResult r;
275 xmlNode *xml_action=NULL;
276 CaptiveVfsParentObject *captive_vfs_parent_object;
277
278         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
279
280         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
281
282         if (captive_vfs_parent_object->corba_bug_action) {
283                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_remove",NULL);
284                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
285                 }
286
287         Captive_File_remove(captive_file_parent_object->corba_File_object,&captive_corba_ev);
288         r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
289         if (xml_action)
290                 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
291         if (r!=GNOME_VFS_OK)
292                 return r;
293
294         return GNOME_VFS_OK;
295 }
296
297
298 GnomeVFSResult captive_sandbox_parent_file_file_info_get(CaptiveFileParentObject *captive_file_parent_object,
299                 GnomeVFSFileInfo *file_info_captive)
300 {
301 Captive_GnomeVFSFileInfo *file_info_corba;
302 GnomeVFSResult r;
303 xmlNode *xml_action=NULL;
304 CaptiveVfsParentObject *captive_vfs_parent_object;
305
306         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
307         g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
308
309         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
310
311         if (captive_vfs_parent_object->corba_bug_action) {
312                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_file_info_get",NULL);
313                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
314                 }
315
316         Captive_File_file_info_get(captive_file_parent_object->corba_File_object,&file_info_corba,&captive_corba_ev);
317         r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
318         if (xml_action)
319                 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
320         if (r!=GNOME_VFS_OK)
321                 return r;
322
323         r=captive_sandbox_file_info_corba_to_captive(file_info_captive,file_info_corba);
324         Captive_GnomeVFSFileInfo__freekids(file_info_corba,NULL/* 'd'; meaning? */);
325         CORBA_free(file_info_corba);
326         if (xml_action)
327                 xmlSetProp(xml_action,"result",gnome_vfs_result_to_string(r));
328         if (r!=GNOME_VFS_OK)
329                 return r;
330
331         return GNOME_VFS_OK;
332 }
333
334
335 GnomeVFSResult captive_sandbox_parent_file_file_info_set(CaptiveFileParentObject *captive_file_parent_object,
336     const GnomeVFSFileInfo *file_info_captive,GnomeVFSSetFileInfoMask mask)
337 {
338 Captive_GnomeVFSFileInfo file_info_corba;
339 GnomeVFSResult r;
340 xmlNode *xml_action=NULL;
341 CaptiveVfsParentObject *captive_vfs_parent_object;
342
343         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
344         g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
345
346         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
347
348         if (captive_vfs_parent_object->corba_bug_action) {
349                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_file_info_set",NULL);
350                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
351                 xmlNewProp(xml_action,"mask",captive_printf_alloca("%u",(unsigned)mask));
352                 }
353
354         if (GNOME_VFS_OK!=(r=captive_sandbox_file_info_captive_to_corba(&file_info_corba,file_info_captive)))
355                 return r;
356
357         Captive_File_file_info_set(captive_file_parent_object->corba_File_object,&file_info_corba,mask,&captive_corba_ev);
358         r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
359         if (xml_action)
360                 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
361         if (r!=GNOME_VFS_OK)
362                 return r;
363
364         Captive_GnomeVFSFileInfo__freekids(&file_info_corba,NULL/* 'd'; meaning? */);
365
366         return GNOME_VFS_OK;
367 }
368
369
370 GnomeVFSResult captive_sandbox_parent_file_truncate(CaptiveFileParentObject *captive_file_parent_object,GnomeVFSFileSize file_size)
371 {
372 GnomeVFSResult r;
373 xmlNode *xml_action=NULL;
374 CaptiveVfsParentObject *captive_vfs_parent_object;
375
376         g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
377
378         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
379
380         if (captive_vfs_parent_object->corba_bug_action) {
381                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_truncate",NULL);
382                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
383                 xmlNewProp(xml_action,"file_size",captive_printf_alloca("%" G_GUINT64_FORMAT,(guint64)file_size));
384                 }
385
386         Captive_File_truncate(captive_file_parent_object->corba_File_object,file_size,&captive_corba_ev);
387         r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
388         if (xml_action)
389                 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
390         if (r!=GNOME_VFS_OK)
391                 return r;
392
393         return GNOME_VFS_OK;
394 }
395
396
397 GnomeVFSResult captive_sandbox_parent_file_move
398                 (CaptiveFileParentObject *captive_file_parent_object_old,const gchar *pathname_new,gboolean force_replace)
399 {
400 GnomeVFSResult r;
401 xmlNode *xml_action=NULL;
402 CaptiveVfsParentObject *captive_vfs_parent_object;
403
404         g_return_val_if_fail(captive_file_parent_object_old!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
405         g_return_val_if_fail(pathname_new!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
406
407         captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object_old)->vfs);
408
409         if (captive_vfs_parent_object->corba_bug_action) {
410                 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_truncate",NULL);
411                 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object_old));
412                 xmlNewProp(xml_action,"pathname_new",pathname_new);
413                 xmlNewProp(xml_action,"force_replace",captive_printf_alloca("%u",(unsigned)force_replace));
414                 }
415
416         Captive_File_move(captive_file_parent_object_old->corba_File_object,pathname_new,force_replace,&captive_corba_ev);
417         r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev);
418         if (xml_action)
419                 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
420         if (r!=GNOME_VFS_OK)
421                 return r;
422
423         return GNOME_VFS_OK;
424 }