Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Data Management

Pierre Gay edited this page May 2, 2013 · 10 revisions

COMDIRAC provide a complete set of commands for Data manipulation through the DIRA FileCatalog (FC).

DCommands Working Directory

After Session Initialization, your environment has a working directory option used to store the path inside the FileCatalog you can use to specify relative paths. These relative paths aren't to be confused with relative paths from your operating shell.

THere are two commands associated with your FileCatalog working directory:

  • dpwd - same as shell pwd commands for FileCatalog context
  • dcd - change your FileCatalog working directory

For example (supposing you just initiated your DCommands session):

$ # print FC working directory
$ dpwd
/vo.france-grilles.fr/user/p/pgay
$ # moving "up"
$ dcd ..
$ dpwd
/vo.france-grilles.fr/user/p
$ # go back to "home_dir" as stored in DCommands session
$ dcd
$ dpwd
/vo.france-grilles.fr/user/p/pgay

FileCatalog Directories

There are some DCommands related to FileCatalog directory manipulation:

  • dls - list FC directory contents
  • dmkdir - create directory
  • drmdir - remove directory

Examples:

$ # create a test directory
$ dmkdir tutorial
Successfully created directory: /vo.france-grilles.fr/user/p/pgay/tutorial
$ dcd tutorial
$ # create a subdirectory
$ dmkdir d1
Successfully created directory: /vo.france-grilles.fr/user/p/pgay/tutorial/d1
$ # two subdirectories at once
$ dmkdir d2 d3
Successfully created directory: /vo.france-grilles.fr/user/p/pgay/tutorial/d2
Successfully created directory: /vo.france-grilles.fr/user/p/pgay/tutorial/d3
$ # inspect current directory
$ dls
/vo.france-grilles.fr/user/p/pgay/tutorial:
d1
d2
d3
$ # more detailed output
$ dls -l
/vo.france-grilles.fr/user/p/pgay/tutorial:
drwxrwxr-x 0 pgay frangrilles_user 0 2013-05-02 20:34:24 d1
drwxrwxr-x 0 pgay frangrilles_user 0 2013-05-02 20:34:31 d2
drwxrwxr-x 0 pgay frangrilles_user 0 2013-05-02 20:34:32 d3
$ dcd ..
$ dpwd
/vo.france-grilles.fr/user/p/pgay
$ # won't work
$ drmdir tutorial
lfn: /vo.france-grilles.fr/user/p/pgay/tutorial
ERROR: Failed to remove non-empty directory
$ # only empty directoris can be removed this way. Be patient
$ drmdir tutorial/d1
lfn: /vo.france-grilles.fr/user/p/pgay/tutorial/d1
Directory /vo.france-grilles.fr/user/p/pgay/tutorial/d1 removed from the catalog
$ drmdir tutorial/d2
lfn: /vo.france-grilles.fr/user/p/pgay/tutorial/d2
Directory /vo.france-grilles.fr/user/p/pgay/tutorial/d2 removed from the catalog
$ drmdir tutorial/d3
lfn: /vo.france-grilles.fr/user/p/pgay/tutorial/d3
Directory /vo.france-grilles.fr/user/p/pgay/tutorial/d3 removed from the catalog
$ drmdir tutorial
lfn: /vo.france-grilles.fr/user/p/pgay/tutorial
Directory /vo.france-grilles.fr/user/p/pgay/tutorial removed from the catalog
Clone this wiki locally