gfal client

This page includes the basic commands to use gfal. For an overview of storage clients, see Storage clients.



To run the examples below you need to have a valid proxy, see StartGridSession.

Mandatory environment settings:



The examples below will work both with TURLs and SURLs.


  • Listing directories on dCache:

    $gfal-ls -l gsi
  • Create a new directory on dCache:

    $gfal-mkdir gsi

Transferring data

  • Copy file from dCache to local machine:

    $gfal-copy gsi file:///`pwd`/zap.tar
  • Copy file from local machine to dCache:

    $gfal-copy file:///`pwd`/zap.tar gsi

Recursive transfer

Recursive transfer of files is not supported with the gfal-copy command.

FIFO transfers

Using a fifo pipe allows you to tar/untar a file on the fly and use half of the space on the WN, e.g. tarring a directory and uploading the tarball to dCache would require 2x(directory size) space on the WN without a fifo.

  • Download a tar ball from dCache using fifo

mkfifo ${INPUT_FIFO}
tar -Bxf ${INPUT_FIFO} & TAR_PID=$!
gfal-copy gsi file:///${PWD}/${INPUT_FIFO} && wait ${TAR_PID}
  • Upload a tar ball to dCache using fifo

tar -Bcf ${OUTPUT_FIFO} ${PWD}/mydir/ & TAR_PID=$!
gfal-copy file:///${PWD}/${OUTPUT_FIFO} gsi && wait ${TAR_PID}

Removing data

  • Remove a file from dCache:

$gfal-rm gsi
  • Remove whole (non-empty) directory with all content from dCache:

$gfal-rm -r gsi


  • Get checksum for a file on dCache:

$gfal-sum gsi ADLER32


  • Get locality (ONLINE, NEARLINE) for a file on dCache:

$gfal-xattr gsi user.status