| 49 | path.zip_file.writestr(zip_info, target.encode()) |
| 50 | |
| 51 | def create_hierarchy(self, p): |
| 52 | # Add regular files |
| 53 | self.create_file(p.joinpath('fileA'), b'this is file A\n') |
| 54 | self.create_file(p.joinpath('dirB/fileB'), b'this is file B\n') |
| 55 | self.create_file(p.joinpath('dirC/fileC'), b'this is file C\n') |
| 56 | self.create_file(p.joinpath('dirC/dirD/fileD'), b'this is file D\n') |
| 57 | self.create_file(p.joinpath('dirC/novel.txt'), b'this is a novel\n') |
| 58 | # Add symlinks |
| 59 | self.create_symlink(p.joinpath('linkA'), 'fileA') |
| 60 | self.create_symlink(p.joinpath('linkB'), 'dirB') |
| 61 | self.create_symlink(p.joinpath('dirA/linkC'), '../dirB') |
| 62 | self.create_symlink(p.joinpath('brokenLink'), 'non-existing') |
| 63 | self.create_symlink(p.joinpath('brokenLinkLoop'), 'brokenLinkLoop') |
| 64 | |
| 65 | def readtext(self, p): |
| 66 | with p.zip_file.open(vfspath(p), 'r') as f: |