File: gfal2_long_listing.py

package info (click to toggle)
gfal2-bindings 1.13.0-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 688 kB
  • sloc: cpp: 2,574; python: 1,050; sh: 109; makefile: 92
file content (22 lines) | stat: -rwxr-xr-x 360 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python

import sys
import gfal2


if(len(sys.argv) < 2):
	print("Usage %s [URL]"%(sys.argv[0]))
	exit(1)

ctxt = gfal2.creat_context()
dirp = ctxt.opendir(sys.argv[1])

while(True):
	(dirent, stat) = dirp.readpp()
	if(dirent is None):
		break;
	print("filename %s, filesize: %d, filerights 0%o"%(dirent.d_name, stat.st_size, stat.st_mode))