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