Hello
I hope you are doing well. I am working on integrating FUSE
<http://fuse.sourceforge.net/>with GridFtp so using the globus client API
for the same. I have a problem that when I am calling this function for
getting MLST listing of an object and the object does not exist, then after
giving error in the callback ("server responded with error") it just
terminates the program rather than going back to the event loop. In that
case this function is not returning anything to the function( in the FUSE
code) which calls it. Where can be the possible error.
Example: In FUSE when I am don't use the Globus Client API and only mount
some local directory then while doing mkdir, first gettattributes is
called. Since the folder does not exist it gives error but then goes to
MKDIR function to create the directory. But when I am doing this for remote
mount with the below function its not returnin back after it shows error in
getattr.
Here is the code part:
int grid_ftp_getattributes(char *url){
char *stat_buffer;
long int stat_buffer_length = 0;
globus_bool_t result = 0;
done=GLOBUS_FALSE;
result = globus_ftp_client_mlst(&handle, url, &attr, &stat_buffer,
&stat_buffer_length, get_file_done_cb, 0);
if (result != GLOBUS_SUCCESS) {
printf("\nError in result\n");
globus_object_t * err;
err = globus_error_get(result);
globus_libc_printf( "\n ERROR : %s\n",
globus_object_printable_to_string(err)); //??
done = GLOBUS_TRUE;
printf("\n6\n");
}else{
printf("success result in getattr\n");
}
/* Block until the mutual exclusion lock, mutex, is acquired */
globus_mutex_lock(&lock);
while (!done) {
/* Atomically release mutex and wait on cond. When the
function returns, mutex has been reacquired*/
globus_cond_wait(&cond, &lock);
}
/* Unlock the mutual exclusion lock, mutex, enabling
another thread to acquire the mutex */
globus_mutex_unlock(&lock);
if ( result == GLOBUS_SUCCESS){
printf("In Globus functns: values in buf r %s\n",stat_buffer);
return 0;
} else {
printf("\nreturning 1 i.e error\n");;
return 1;
}
return -1;
}
void get_file_done_cb(void* user_arg, globus_ftp_client_handle_t*
handle,globus_object_t* err) {
char *tmp;
if (err != GLOBUS_SUCCESS) {
tmp = globus_object_printable_to_string(err);
globus_libc_fprintf(stderr,"\n\t\t Error in callback : %s\n",tmp);
}
else {
printf("Successful callback\n");
globus_libc_printf(" \n\t\t Status : File getattributes
successful\n");
}
/*Block until the mutual exclusion lock, mutex, is acquired*/
globus_mutex_lock(&lock);
done=GLOBUS_TRUE;
/* signal the specifide condition ,waking up one thread that is
suspended on this
condition .If no thread are suspended on this condition ,this call
will have no
effect.*/
globus_cond_signal(&cond);
printf("\n3\n");
/* Unlock the mutual exclusion lock, mutex, enabling
another thread to acquire the mutex.*/
globus_mutex_unlock(&lock);
}
I would be grateful for your reply.
Thanks in advance
--
Shobhit Puri
Fourth Year Undergraduate Student
Department of Information Technology
Indian Institute of Information Technology, Allahabad, India
Currently Intern at Karlsruhe Institute of Technology, Karlsruhe, Germany
Email: [email protected], [email protected]
Phone: +49-15736153084, +91-9457011377