lcg_get_checksum_python(3) - Linux man page
Name
lcg_get_checksum - Get/compute checksum value of given filesSynopsis
import lcg_util(int returncode, listOfDict checksums, string errmsg ) lcg_util.lcg_get_checksum (listOfStrings files, string defaulttype, string setype, int nobdii, int force, string vo, enum gfal_cksm_type cksmtype)
Description
- nbfiles
- specifies the number of elements in files.
- files
- specifies a list of files of size nbfiles.
- defaulttype
- specifies the default SE type you want to use. Possible values are TYPE_NONE, TYPE_SE, TYPE_SRM, TYPE_SRMv2, for respectively no default type, classic SE, SRMv1, and SRMv2. But if according to the BDII the default type is not available for this SE, it will use another type.
- setype
- specifies the SE type you want to use for the source file. Possible values are TYPE_NONE, TYPE_SE, TYPE_SRM, TYPE_SRMv2, for respectively no type, classic SE, SRMv1, and SRMv2. But if according to the BDII the default type is not available for this SE, it will fail.
- nobdii
- If set to a non-zero value, it means that you don't want to make BDII calls to get SE type. So, you must provide the type of the SE for srm: arguments, and full endpoint in SURLs. For SE type, defaulttype can be used.
- force
- If set to a non-zero value, it means that the checksum value won't be obtained from srmLs function (even if available there). So the value is obtained either from gridftp, or it is computed (for local files). Note that some SEs support checksum through srmLs only, so this option may make the command fail in this case.
- vo
- specifies the Virtual Organization the user belongs to. If it is not specified, the environment variable LCG_GFAL_VO will be used.
- cksmtype
- is the checksum type (algorithm) to use. Possible values are:
- GFAL_CKSM_NONE
- default type will be used (Adler32)
- GFAL_CKSM_CRC32
- CRC32 algorithm will be used
- GFAL_CKSM_ADLER32
- Adler32 algorithm will be used
- GFAL_CKSM_MD5
- MD5 algorithm will be used
- GFAL_CKSM_SHA1
- checksums
- It is an out argument to show the status of each each file, with possibly an explanation. So this is a pointer to a table of structures, which contains the following fields:
- char *file
- the file name
- int status
- the status of the file, which is a value of errno
- char *explanation
- an explanation of this status (can be NULL)
- char *checksum
- checksum value of the file, if available/computable.
- errbuf
- specifies a buffer of size errbufsz to receive detailed error messages. If this pointer is NULL, the message goes to stderr. The pointer should not be NULL if the application is a daemon or is multi-threaded.
Note
The environment variable LCG_GFAL_INFOSYS must point to the BDII, unless nobdii is set to a non-zero value. To use the RLS as catalog instead of the LFC, the environment variable LCG_CATALOG_TYPE must explicitely be set to "edg". By default, it is set to "lfc".Return Value
This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, errno is set appropriately.Errors
- ENOENT
- The named file does not exist.
- EACCES
- Permission denied.
- EFAULT
- file or vo is an invalid pointer.
- ECOMM
- Communication error.
- ENAMETOOLONG
- vo is too long.
- EPROTONOSUPPORT
- Access method not supported.
Files
/opt/lcg/include/lcg_util.h- /opt/lcg/lib/liblcg_util.so