Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 21 lines (18 sloc) 0.469 kb
#!/usr/bin/python
# (c) Anil Madhavapeddy, Citrix Systems Inc, 2008
# Checks for the existence of a file on a device
import os, sys
import fsimage
if __name__ == "__main__":
if len(sys.argv) != 3:
print "Usage: %s <device> <file>" % sys.argv[0]
sys.exit(2)
device = sys.argv[1]
file = sys.argv[2]
try:
fs = fsimage.open(device, 0)
if fs.file_exists(file):
os._exit(0)
except:
pass
os._exit(1)
Jump to Line
Something went wrong with that request. Please try again.