Introduction
Imagine you have many documents on your computer, and you want to know details about each one or change them. File attributes and operations help you see information about files and do things like open, read, or delete them.
Think of files like books in a library. Each book has a label with details like title, author, and genre (attributes). The library controls who can borrow or read the book (permissions). You can check out a book to read, write notes in it, or return it (operations).
┌─────────────────────┐ │ File System │ ├─────────┬───────────┤ │Attributes│ Operations│ │─────────│───────────│ │ Name │ Create │ │ Size │ Open │ │ Type │ Read │ │ Dates │ Write │ │ Perms │ Close │ │ │ Rename │ │ │ Delete │ └─────────┴───────────┘
import os file_path = 'example.txt' size = os.path.getsize(file_path) print(size)What does this code output?
mv file1.txt file2.txt/
Pass the test and this pattern moves unknown