xref: /freebsd/contrib/pjdfstest/tests/open/13.t (revision 41059135ce931c0f1014a999ffabc6bc470ce856)
1#!/bin/sh
2# $FreeBSD: head/tools/regression/pjdfstest/tests/open/13.t 211352 2010-08-15 21:24:17Z pjd $
3
4desc="open returns EISDIR when trying to open a directory for writing"
5
6dir=`dirname $0`
7. ${dir}/../misc.sh
8
9require chflags
10
11echo "1..8"
12
13n0=`namegen`
14
15expect 0 mkdir ${n0} 0755
16
17expect 0 open ${n0} O_RDONLY
18expect EISDIR open ${n0} O_WRONLY
19expect EISDIR open ${n0} O_RDWR
20expect EISDIR open ${n0} O_RDONLY,O_TRUNC
21expect EISDIR open ${n0} O_WRONLY,O_TRUNC
22expect EISDIR open ${n0} O_RDWR,O_TRUNC
23
24expect 0 rmdir ${n0}
25