Content-type: text/html Man page of GFAL_INIT


Section: Library Functions (3)
Updated: $Date: 2009/04/16 13:56:37 $
Index Return to Main Contents


gfal_init - generates a 'gfal_internal' object  


import gfal

(int returncode, gfal_internal gfal, string errmsg ) gfal_init (dict req );  


gfal_init generates a gfal_internal object from user parameters stored in a gfal_request object. It is important to note that user parameters must not be freed while gfal is needed. This object can/should be used several times for requests on same files.

It is very important to not modify such an object by hand, it have to be seen as a black box.

Python dictionary in which you have to put your parameters. To have the list of available parameters see the next section Parameters in req.
gfal_internal object to be passed to other functions.



listOfString surls
Is the list of SURLs on which you want to do actions. It is mandatory in all cases, except when you want to generate new file names (to create new file on a SE) (see generatesurls parameter).
int generatesurls
If set to '1' and surls is set to NULL, gfal_init() will generate nbfiles file names. It is useful when you want to put new files on a SE, and you don't want a specific file name. But in this case, the parameter endpoint must be set to the SE host name on which you want to create files, when to set generatesurls to '1'. In all other cases, it is ignored. Moreover, to generate file names, BDII is required to get the root path, so it is not compatible with no_bdii_check parameter.
string relative_path
Is used during file name generation ( generatesurls is set to '1'), to specify the default sub-directory (in the root path) in which to put files. In all other cases, it is ignored.
int oflag
Allows to specify if it is a get or a put action. It is only used by gfal_turlsfromsurls() function. By default, the function considers it is a get request.
listOfInt filesizes
It is only used and mandatory when oflag is set to '1'. It is a table of size nbfiles in which there are the sizes of the files what will be put on the SE.
string defaultsetype
Allows to specify the default type of the given SE to be used. The possible values are none, se, srmv1, srmv2. They respectively correspond to no default type, Classic SE, SRM v1, SRMv2. If BDII calls are not disabled, and there no entry for the given SE with this type, but for another type, the latter will be used. By default, it is set to none.
string setype
Allows to specify the type of the given SE to be used. The possible values are none, se, srmv1, srmv2. They respectively correspond to no default type, Classic SE, SRM v1, SRMv2. If BDII calls are not disabled, and there no entry for the given SE with this type, it will fails. By default, it is set to none.
int no_bdii_check
Disables call to BDII. So the SE type cannot be get from there, what means that you have to specify it either with defaultsetype or with setype. Moreover, as BDII can't be used to get SE parameters (port number, service path), at least the first SURLs has to contain the full endpoint (eg. srm:// It is not compatible with generatesurls.
int timeout
Specifies the time before which remote servers are considered as down. By default, there is no timeout.
listOfString protocols
Specifies the list of protocols to use to communicate with the SE. By defaut, it will be set to all protocols understandable by the system (the system has the corresponding library).
The following parameters are SRMv2-specific, what means that specifying them will force the type of the SE to SRMv2. So it is not compatible with setting setype to another value than none or srmv2.

char *srmv2_spacetokendesc
Specifies the space token to used with the given SE.
int srmv2_desiredpintime
Specifies the desired pin life time for files on the given SE. It is only used by gfal_pin(), gfal_turlsfromsurls, gfal_get.
int srmv2_lslevels
It is only used by gfal_ls. Specifies the number of levels of recursion. Possible values are only '0' (no directory listing) or '1' (one level of directory listing).
int srmv2_lsoffset
It is only used by gfal_ls. Specifies the offset from which the listing must begin. In other words, it is the number of file entries to skip.
int srmv2_lscount
It is only used by gfal_ls. Specifies the maximum number of files to get. Keep in mind that SEs have also a maximum limit, so whatever you specify here, the number of files will never be higher than the SE limit.



This routine returns 0 on a success, or -1 in case of error. In the latter case, errno is set appropriately. Moreover, you can get an error message from errbuf , if specified.



errno indicates the type of error, but for detailled error message, you have to look into errbuf.
One or more parameter in req have a wrong value.
Not enough free memory.



gfal_python(3), gfal_init_python(3), gfal_internal_free_python(3), gfal_deletesurls_python(3), gfal_removedir_python(3), gfal_get_python(3), gfal_getstatus_python(3), gfal_ls_python(3), gfal_pin_python(3), gfal_prestage_python(3), gfal_prestagestatus_python(3), gfal_release_python(3), gfal_abortrequest_python(3), gfal_abortfiles_python(3), gfal_set_xfer_done_python(3), gfal_set_xfer_running_python(3), gfal_turlsfromsurls_python(3), gfal_get_ids_python(3), gfal_set_ids_python(3), gfal_get_results_python(3), gfal_access_python(3), gfal_chmod_python(3), gfal_close_python(3), gfal_closedir_python(3), gfal_creat_python(3), gfal_get_timeout_connect_python(3), gfal_get_timeout_sendreceive_python(3), gfal_get_timeout_bdii_python(3), gfal_get_timeout_srm_python(3), gfal_set_timeout_connect_python(3), gfal_set_timeout_sendreceive_python(3), gfal_set_timeout_bdii_python(3), gfal_set_timeout_srm_python(3), gfal_lseek_python(3), gfal_mkdir_python(3), gfal_open_python(3), gfal_opendir_python(3), gfal_read_python(3), gfal_rename_python(3), gfal_rmdir_python(3), gfal_stat_python(3), gfal_unlink_python(3), gfal_write_python(3), gfal_set_verbose_python(3), gfal_get_errno_python(3),




This document was created by man2html, using the manual pages.
Time: 14:16:31 GMT, July 14, 2009