Try this:
(defun check-readonly-file (file)
;|
Cheking REadONly file
Call args:
file - filename, string
Returns:
-1 -> File not exist
0 -> File is not read-only
1 -> File is read-only
|;
(cond
((not (findfile file))
;(princ "\nFile not found")
-1
)
((not (vl-file-systime (findfile file)))
;(princ "\nFile is ReadOnly")
0
)
(t
1
;(princ "\nEverything OK")
)
) ;_ end of cond
) ;_ end of defun