| #! /usr/bin/env python | |
| import sys,os | |
| from stat import * | |
#!/bin/bash | |
FILE=$1 | |
FILE=str(sys.argv[1]) | |
if [ -f $FILE ]; then echo "File $FILE exists." else echo "File $FILE does not exist." fi | |
if ((os.path.isfile(str(FILE) ) and S_ISREG(os.stat(str(FILE) ).st_mode)) ):
print("File "+str(FILE)+" exists.")
else:
print("File "+str(FILE)+" does not exist.") | |
if [ -b $FILE ];
then
echo "File $FILE exists and is a block-special file."
else
echo "Not a block-special file"
fi
| |
if (S_ISBLK(os.stat(str(FILE) ).st_mode) ):
print("File "+str(FILE)+" exists and is a block-special file.")
else:
print("Not a block-special file") | |
ÿ |