Software: Apache. PHP/7.3.33 uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) Safe-mode: OFF (not secure) /opt/cloudlinux/venv/lib/python3.11/site-packages/testfixtures/tests/ drwxr-xr-x |
Viewing file: Select action/file-type: Here's an example piece of code that creates some files and directories: .. code-block:: python import os def spew(path): with open(os.path.join(path, 'root.txt'), 'wb') as f: f.write(b'root output') os.mkdir(os.path.join(path, 'subdir')) with open(os.path.join(path, 'subdir', 'file.txt'), 'wb') as f: f.write(b'subdir output') os.mkdir(os.path.join(path, 'subdir', 'logs')) This function is used as follows: >>> spew(tempdir.path) This will create the following files and directories:: root.txt subdir/ subdir/file.txt subdir/logs/ .. -> expected_listing .. invisible-code-block: python # check the listing was as expected tempdir.compare(expected_listing.strip().split('\n')) |
:: Command execute :: | |
--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0041 ]-- |