summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2016-02-15 20:30:40 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2016-02-15 20:30:40 (GMT)
commitb0f4c6bc7b32102a75e2d6c8ef880e6135cbfd53 (patch)
tree37bde0110ac00ab47747adb7df24b4d98f6b08c9
parentb7bf26899595e90e1cc6937fb18fd5702bec8d8d (diff)
parent3909c2e02d5497858dcb509f09fe5766a9aa0b4d (diff)
downloadSCons-b0f4c6bc7b32102a75e2d6c8ef880e6135cbfd53.zip
SCons-b0f4c6bc7b32102a75e2d6c8ef880e6135cbfd53.tar.gz
SCons-b0f4c6bc7b32102a75e2d6c8ef880e6135cbfd53.tar.bz2
Merged in adarshsanjeev/scons (pull request #291)
-rw-r--r--doc/generated/examples/caching_ex-random_1.xml4
-rw-r--r--doc/generated/examples/tasks_ex1_1.xml2
-rw-r--r--doc/generated/examples/troubleshoot_Dump_1.xml2
-rw-r--r--doc/generated/examples/troubleshoot_Dump_2.xml2
-rw-r--r--doc/generated/examples/troubleshoot_explain1_3.xml2
-rw-r--r--doc/generated/examples/troubleshoot_stacktrace_2.xml4
-rw-r--r--doc/generated/tools.gen12
-rw-r--r--doc/generated/tools.mod4
-rw-r--r--doc/generated/variables.gen40
-rw-r--r--doc/man/scons.xml9
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/engine/SCons/Defaults.py64
-rw-r--r--test/Chmod.py46
13 files changed, 153 insertions, 40 deletions
diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml
index 6a0337b..cb14259 100644
--- a/doc/generated/examples/caching_ex-random_1.xml
+++ b/doc/generated/examples/caching_ex-random_1.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-cc -o f2.o -c f2.c
cc -o f1.o -c f1.c
+cc -o f4.o -c f4.c
cc -o f5.o -c f5.c
cc -o f3.o -c f3.c
-cc -o f4.o -c f4.c
+cc -o f2.o -c f2.c
cc -o prog f1.o f2.o f3.o f4.o f5.o
</screen>
diff --git a/doc/generated/examples/tasks_ex1_1.xml b/doc/generated/examples/tasks_ex1_1.xml
index 5760a45..4885fde 100644
--- a/doc/generated/examples/tasks_ex1_1.xml
+++ b/doc/generated/examples/tasks_ex1_1.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
+cat &lt; test.bar &gt; test.h
cc -o app main.cpp
cat &lt; foo.bar2 &gt; foo.cpp
cc -o app2 main2.cpp foo.cpp
-cat &lt; test.bar &gt; test.h
</screen>
diff --git a/doc/generated/examples/troubleshoot_Dump_1.xml b/doc/generated/examples/troubleshoot_Dump_1.xml
index bf141a0..99d1399 100644
--- a/doc/generated/examples/troubleshoot_Dump_1.xml
+++ b/doc/generated/examples/troubleshoot_Dump_1.xml
@@ -47,7 +47,7 @@ scons: Reading SConscript files ...
'PROGSUFFIX': '',
'PSPAWN': &lt;function piped_env_spawn at 0x700000&amp;gt;,
'RDirs': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'SCANNERS': [],
+ 'SCANNERS': [&lt;SCons.Scanner.Base object at 0x700000&amp;gt;],
'SHELL': 'sh',
'SHLIBPREFIX': '$LIBPREFIX',
'SHLIBSUFFIX': '.so',
diff --git a/doc/generated/examples/troubleshoot_Dump_2.xml b/doc/generated/examples/troubleshoot_Dump_2.xml
index 0ae8fe1..a621422 100644
--- a/doc/generated/examples/troubleshoot_Dump_2.xml
+++ b/doc/generated/examples/troubleshoot_Dump_2.xml
@@ -71,7 +71,7 @@ scons: Reading SConscript files ...
'RCFLAGS': [],
'RCSUFFIXES': ['.rc', '.rc2'],
'RDirs': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'SCANNERS': [],
+ 'SCANNERS': [&lt;SCons.Scanner.Base object at 0x700000&amp;gt;],
'SHCC': '$CC',
'SHCCCOM': &lt;SCons.Action.FunctionAction object at 0x700000&amp;gt;,
'SHCCFLAGS': ['$CCFLAGS'],
diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml
index 3d8592d..7e495ea 100644
--- a/doc/generated/examples/troubleshoot_explain1_3.xml
+++ b/doc/generated/examples/troubleshoot_explain1_3.xml
@@ -3,5 +3,5 @@
cp file.in file.oout
scons: warning: Cannot find target file.out after building
-File "/scons/as_scons/bootstrap/src/script/scons.py", line 199, in &lt;module&gt;
+File "/home/ghost/projects/scons/bootstrap/src/script/scons.py", line 199, in &lt;module&gt;
</screen>
diff --git a/doc/generated/examples/troubleshoot_stacktrace_2.xml b/doc/generated/examples/troubleshoot_stacktrace_2.xml
index add59ff..1de0dcf 100644
--- a/doc/generated/examples/troubleshoot_stacktrace_2.xml
+++ b/doc/generated/examples/troubleshoot_stacktrace_2.xml
@@ -4,10 +4,10 @@ scons: *** [prog.o] Source `prog.c' not found, needed by target `prog.o'.
scons: internal stack trace:
File "bootstrap/src/engine/SCons/Job.py", line 199, in start
task.prepare()
- File "bootstrap/src/engine/SCons/Script/Main.py", line 173, in prepare
+ File "bootstrap/src/engine/SCons/Script/Main.py", line 164, in prepare
return SCons.Taskmaster.OutOfDateTask.prepare(self)
File "bootstrap/src/engine/SCons/Taskmaster.py", line 191, in prepare
executor.prepare()
- File "bootstrap/src/engine/SCons/Executor.py", line 430, in prepare
+ File "bootstrap/src/engine/SCons/Executor.py", line 427, in prepare
raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0]))
</screen>
diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen
index ba12966..fcb7587 100644
--- a/doc/generated/tools.gen
+++ b/doc/generated/tools.gen
@@ -780,19 +780,19 @@ Sets construction variables for the
</para>
<para>Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.</para><para>Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;.</para></listitem>
</varlistentry>
- <varlistentry id="t-Packaging">
- <term>Packaging</term>
+ <varlistentry id="t-packaging">
+ <term>packaging</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Sets construction variables for the <function xmlns="http://www.scons.org/dbxsd/v1.0">Package</function> Builder.
+A framework for building binary and source packages.
</para>
</listitem>
</varlistentry>
- <varlistentry id="t-packaging">
- <term>packaging</term>
+ <varlistentry id="t-Packaging">
+ <term>Packaging</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-A framework for building binary and source packages.
+Sets construction variables for the <function xmlns="http://www.scons.org/dbxsd/v1.0">Package</function> Builder.
</para>
</listitem>
</varlistentry>
diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod
index 2ee2270..1191e6a 100644
--- a/doc/generated/tools.mod
+++ b/doc/generated/tools.mod
@@ -78,8 +78,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-mwcc "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>mwcc</literal>">
<!ENTITY t-mwld "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>mwld</literal>">
<!ENTITY t-nasm "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>nasm</literal>">
-<!ENTITY t-Packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>Packaging</literal>">
<!ENTITY t-packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>packaging</literal>">
+<!ENTITY t-Packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>Packaging</literal>">
<!ENTITY t-pdf "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdf</literal>">
<!ENTITY t-pdflatex "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdflatex</literal>">
<!ENTITY t-pdftex "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdftex</literal>">
@@ -189,8 +189,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-link-mwcc "<link linkend='t-mwcc' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>mwcc</literal></link>">
<!ENTITY t-link-mwld "<link linkend='t-mwld' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>mwld</literal></link>">
<!ENTITY t-link-nasm "<link linkend='t-nasm' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>nasm</literal></link>">
-<!ENTITY t-link-Packaging "<link linkend='t-Packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>Packaging</literal></link>">
<!ENTITY t-link-packaging "<link linkend='t-packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>packaging</literal></link>">
+<!ENTITY t-link-Packaging "<link linkend='t-Packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>Packaging</literal></link>">
<!ENTITY t-link-pdf "<link linkend='t-pdf' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdf</literal></link>">
<!ENTITY t-link-pdflatex "<link linkend='t-pdflatex' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdflatex</literal></link>">
<!ENTITY t-link-pdftex "<link linkend='t-pdftex' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdftex</literal></link>">
diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen
index b377102..b64eb5a 100644
--- a/doc/generated/variables.gen
+++ b/doc/generated/variables.gen
@@ -2838,15 +2838,6 @@ is <quote><literal>-dNOPAUSE -dBATCH -sDEVICE=pdfwrite</literal></quote>
<term>HOST_ARCH</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
- The name of the host hardware architecture used to create the Environment.
- If a platform is specified when creating the Environment, then
- that Platform's logic will handle setting this value.
- This value is immutable, and should not be changed by the user after
- the Environment is initialized.
- Currently only set for Win32.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
Sets the host architecture for Visual Studio compiler. If not set,
default to the detected host architecture: note that this may depend
on the python you are using.
@@ -2862,7 +2853,16 @@ Valid values are the same as for <envar xmlns="http://www.scons.org/dbxsd/v1.0">
This is currently only used on Windows, but in the future it will be
used on other OSes as well.
</para>
-</listitem>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The name of the host hardware architecture used to create the Environment.
+ If a platform is specified when creating the Environment, then
+ that Platform's logic will handle setting this value.
+ This value is immutable, and should not be changed by the user after
+ the Environment is initialized.
+ Currently only set for Win32.
+</para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-HOST_OS">
<term>HOST_OS</term>
@@ -3104,7 +3104,7 @@ The command line used to call the Java archive tool.
<para xmlns="http://www.scons.org/dbxsd/v1.0">
The string displayed when the Java archive tool
is called
-If this is not set, then <envar xmlns="http://www.scons.org/dbxsd/v1.0">$JARCOM</envar> (the command line) is displayed.
+If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-JARCOM"><envar>$JARCOM</envar></link> (the command line) is displayed.
</para>
<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
@@ -3114,7 +3114,7 @@ env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET")
<para xmlns="http://www.scons.org/dbxsd/v1.0">
The string displayed when the Java archive tool
is called
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-JARCOM"><envar>$JARCOM</envar></link> (the command line) is displayed.
+If this is not set, then <envar xmlns="http://www.scons.org/dbxsd/v1.0">$JARCOM</envar> (the command line) is displayed.
</para>
<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
@@ -7038,13 +7038,6 @@ that may not be set or used in a construction environment.
<term>TARGET_ARCH</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
- The name of the target hardware architecture for the compiled objects
- created by this Environment.
- This defaults to the value of HOST_ARCH, and the user can override it.
- Currently only set for Win32.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
Sets the target architecture for Visual Studio compiler (i.e. the arch
of the binaries generated by the compiler). If not set, default to
<envar xmlns="http://www.scons.org/dbxsd/v1.0">$HOST_ARCH</envar>, or, if that is unset, to the architecture of the
@@ -7069,7 +7062,14 @@ and <literal>ia64</literal> (Itanium).
For example, if you want to compile 64-bit binaries, you would set
<literal>TARGET_ARCH='x86_64'</literal> in your SCons environment.
</para>
-</listitem>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The name of the target hardware architecture for the compiled objects
+ created by this Environment.
+ This defaults to the value of HOST_ARCH, and the user can override it.
+ Currently only set for Win32.
+</para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-TARGET_OS">
<term>TARGET_OS</term>
diff --git a/doc/man/scons.xml b/doc/man/scons.xml
index 5c832c2..c72178e 100644
--- a/doc/man/scons.xml
+++ b/doc/man/scons.xml
@@ -5630,7 +5630,8 @@ env.Command('foo.out', 'foo.in',
changes the permissions on the specified
<emphasis>dest</emphasis>
file or directory to the specified
-<emphasis>mode</emphasis>.
+<emphasis>mode</emphasis>
+which can be octal or string, similar to the bash command.
Examples:</para>
<literallayout class="monospaced">
@@ -5639,6 +5640,12 @@ Execute(Chmod('file', 0755))
env.Command('foo.out', 'foo.in',
[Copy('$TARGET', '$SOURCE'),
Chmod('$TARGET', 0755)])
+
+Execute(Chmod('file', "ugo+w"))
+
+env.Command('foo.out', 'foo.in',
+ [Copy('$TARGET', '$SOURCE'),
+ Chmod('$TARGET', "ugo+w")])
</literallayout>
</listitem>
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index dc8a281..c68b89c 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -30,6 +30,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
From Jakub Pola:
- Intel Compiler 2016 (Linux/Mac) update for tool directories.
+ From Adarsh Sanjeev:
+ - Fix for issue #2494: Added string support for Chmod function.
RELEASE 2.4.1 - Mon, 07 Nov 2015 10:37:21 -0700
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index c1bd902..6344975 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -169,15 +169,73 @@ def get_paths_str(dest):
else:
return '"' + str(dest) + '"'
+permission_dic = {
+ 'u':{
+ 'r':stat.S_IRUSR,
+ 'w':stat.S_IWUSR,
+ 'x':stat.S_IXUSR
+ },
+ 'g':{
+ 'r':stat.S_IRGRP,
+ 'w':stat.S_IWGRP,
+ 'x':stat.S_IXGRP
+ },
+ 'o':{
+ 'r':stat.S_IROTH,
+ 'w':stat.S_IWOTH,
+ 'x':stat.S_IXOTH
+ }
+}
+
def chmod_func(dest, mode):
+ import SCons.Util
+ from string import digits
SCons.Node.FS.invalidate_node_memos(dest)
if not SCons.Util.is_List(dest):
dest = [dest]
- for element in dest:
- os.chmod(str(element), mode)
+ if SCons.Util.is_String(mode) and not 0 in [i in digits for i in mode]:
+ mode = int(mode, 8)
+ if not SCons.Util.is_String(mode):
+ for element in dest:
+ os.chmod(str(element), mode)
+ else:
+ mode = str(mode)
+ for operation in mode.split(","):
+ if "=" in operation:
+ operator = "="
+ elif "+" in operation:
+ operator = "+"
+ elif "-" in operation:
+ operator = "-"
+ else:
+ raise SyntaxError("Could not find +, - or =")
+ operation_list = operation.split(operator)
+ if len(operation_list) is not 2:
+ raise SyntaxError("More than one operator found")
+ user = operation_list[0].strip().replace("a", "ugo")
+ permission = operation_list[1].strip()
+ new_perm = 0
+ for u in user:
+ for p in permission:
+ try:
+ new_perm = new_perm | permission_dic[u][p]
+ except KeyError:
+ raise SyntaxError("Unrecognized user or permission format")
+ for element in dest:
+ curr_perm = os.stat(str(element)).st_mode
+ if operator == "=":
+ os.chmod(str(element), new_perm)
+ elif operator == "+":
+ os.chmod(str(element), curr_perm | new_perm)
+ elif operator == "-":
+ os.chmod(str(element), curr_perm & ~new_perm)
def chmod_strfunc(dest, mode):
- return 'Chmod(%s, 0%o)' % (get_paths_str(dest), mode)
+ import SCons.Util
+ if not SCons.Util.is_String(mode):
+ return 'Chmod(%s, 0%o)' % (get_paths_str(dest), mode)
+ else:
+ return 'Chmod(%s, "%s")' % (get_paths_str(dest), str(mode))
Chmod = ActionFactory(chmod_func, chmod_strfunc)
diff --git a/test/Chmod.py b/test/Chmod.py
index c00aea0..c5b2a8d 100644
--- a/test/Chmod.py
+++ b/test/Chmod.py
@@ -64,6 +64,11 @@ env.Command('f7.out', 'f7.in', [Cat,
env = Environment(FILE = 'f9')
env.Command('f8.out', 'f8.in', [Chmod(['$FILE', File('f10')], 0666), Cat])
Execute(Chmod(['d11', Dir('d12')], 0777))
+Execute(Chmod('f13', "a=r"))
+Execute(Chmod('f14', "ogu+w"))
+Execute(Chmod('f15', "ug=rw, go+ rw"))
+Execute(Chmod('d16', "0777"))
+Execute(Chmod(['d17', 'd18'], "ogu = rwx"))
""")
test.write('f1', "f1\n")
@@ -86,6 +91,12 @@ test.write('f9', "f9\n")
test.write('f10', "f10\n")
test.subdir('d11')
test.subdir('d12')
+test.write('f13', "f13\n")
+test.write('f14', "f14\n")
+test.write('f15', "f15\n")
+test.subdir('d16')
+test.subdir('d17')
+test.subdir('d18')
os.chmod(test.workpath('f1'), 0444)
os.chmod(test.workpath('f1-File'), 0444)
@@ -100,6 +111,12 @@ os.chmod(test.workpath('f9'), 0444)
os.chmod(test.workpath('f10'), 0444)
os.chmod(test.workpath('d11'), 0555)
os.chmod(test.workpath('d12'), 0555)
+os.chmod(test.workpath('f13'), 0444)
+os.chmod(test.workpath('f14'), 0444)
+os.chmod(test.workpath('f15'), 0444)
+os.chmod(test.workpath('d16'), 0555)
+os.chmod(test.workpath('d17'), 0555)
+os.chmod(test.workpath('d18'), 0555)
expect = test.wrap_stdout(read_str = """\
Chmod("f1", 0666)
@@ -107,6 +124,11 @@ Chmod("f1-File", 0666)
Chmod("d2", 0777)
Chmod("d2-Dir", 0777)
Chmod(["d11", "d12"], 0777)
+Chmod("f13", "a=r")
+Chmod("f14", "ogu+w")
+Chmod("f15", "ug=rw, go+ rw")
+Chmod("d16", "0777")
+Chmod(["d17", "d18"], "ogu = rwx")
""",
build_str = """\
cat(["bar.out"], ["bar.in"])
@@ -152,6 +174,18 @@ s = stat.S_IMODE(os.stat(test.workpath('d11'))[stat.ST_MODE])
test.fail_test(s != 0555)
s = stat.S_IMODE(os.stat(test.workpath('d12'))[stat.ST_MODE])
test.fail_test(s != 0555)
+s = stat.S_IMODE(os.stat(test.workpath('f13'))[stat.ST_MODE])
+test.fail_test(s != 0444)
+s = stat.S_IMODE(os.stat(test.workpath('f14'))[stat.ST_MODE])
+test.fail_test(s != 0444)
+s = stat.S_IMODE(os.stat(test.workpath('f15'))[stat.ST_MODE])
+test.fail_test(s != 0444)
+s = stat.S_IMODE(os.stat(test.workpath('d16'))[stat.ST_MODE])
+test.fail_test(s != 0555)
+s = stat.S_IMODE(os.stat(test.workpath('d17'))[stat.ST_MODE])
+test.fail_test(s != 0555)
+s = stat.S_IMODE(os.stat(test.workpath('d18'))[stat.ST_MODE])
+test.fail_test(s != 0555)
test.run()
@@ -185,6 +219,18 @@ s = stat.S_IMODE(os.stat(test.workpath('d11'))[stat.ST_MODE])
test.fail_test(s != 0777)
s = stat.S_IMODE(os.stat(test.workpath('d12'))[stat.ST_MODE])
test.fail_test(s != 0777)
+s = stat.S_IMODE(os.stat(test.workpath('f13'))[stat.ST_MODE])
+test.fail_test(s != 0444)
+s = stat.S_IMODE(os.stat(test.workpath('f14'))[stat.ST_MODE])
+test.fail_test(s != 0666)
+s = stat.S_IMODE(os.stat(test.workpath('f15'))[stat.ST_MODE])
+test.fail_test(s != 0666)
+s = stat.S_IMODE(os.stat(test.workpath('d16'))[stat.ST_MODE])
+test.fail_test(s != 0777)
+s = stat.S_IMODE(os.stat(test.workpath('d17'))[stat.ST_MODE])
+test.fail_test(s != 0777)
+s = stat.S_IMODE(os.stat(test.workpath('d18'))[stat.ST_MODE])
+test.fail_test(s != 0777)
test.pass_test()