rwx/__main__.py

19 lines
463 B
Python
Raw Normal View History

2023-03-28 21:54:38 +00:00
#! /usr/bin/env python3
2023-07-17 19:05:06 +00:00
import os
2023-10-10 20:11:57 +00:00
import fs
2023-07-17 19:05:06 +00:00
2023-03-28 21:54:38 +00:00
if __name__ == '__main__':
2023-07-17 19:05:06 +00:00
file_path = os.path.realpath(__file__)
root_path = os.path.dirname(file_path)
directory_path = os.path.join(root_path, 'tmp')
file_path = os.path.join(directory_path, 'file')
2023-10-10 20:11:57 +00:00
fs.wipe(directory_path)
fs.make_directory(directory_path)
fs.write(file_path, 'Martine écrit beaucoup.')
fs.empty_file(file_path)
fs.write(file_path, 'Martine écrit moins.')