About 3,330,000 results
Open links in new tab
  1. How to read file attributes in a directory? - Stack Overflow

    Apr 26, 2021 · When looking for file attributes for all files in a directory, and you are using Python 3.5 or newer, use the os.scandir() function to get a directory listing with file attributes combined.

  2. File Objects in Python - GeeksforGeeks

    Apr 3, 2017 · A file object allows us to use, access and manipulate all the user accessible files. One can read and write any such files. When a file operation fails for an I/O-related reason, …

  3. Files in python, File Built-in Function, File Built-in Attributes ...

    Python has a built-in function open () to open a file. Which accepts two arguments, file name and access mode in which the file is accessed. The function returns a file object which can be used …

  4. File and Directory Access — Python 3.13.3 documentation

    2 days ago · File and Directory Access ¶ The modules described in this chapter deal with disk files and directories. For example, there are modules for reading the properties of files, …

  5. How to Retrieve and Set File Metadata and Attributes in Python

    Using these methods, you can flexibly retrieve and set file attributes in Python, enhancing file management and security. Practical Example: Modifying File Timestamps

  6. Working With Files in Python

    Python has several built-in modules and functions for handling files. These functions are spread out over several modules such as os, os.path, shutil, and pathlib, to name a few. This article …

  7. Get file attributes (hidden, readonly, system, archive) in Python

    Nov 29, 2014 · Since Python 3.5, os.stat(), os.fstat() and os.lstat() returns a class os.stat_result that, on Windows systems, includes st_file_attributes. You can use the FILE_ATTRIBUTE_* …

  8. File Handling in Python - GeeksforGeeks

    Jan 14, 2025 · To open a file we can use open() function, which requires file path and mode as arguments: This code opens file named geeks.txt. When opening a file, we must specify the …

  9. Mastering File Metadata and Attributes in Python: A …

    This comprehensive guide has covered the retrieval and setting of file metadata and attributes using Python. With the provided examples and explanations, developers can efficiently …

  10. Checking file attributes in python - Stack Overflow

    Mar 18, 2009 · I'd like to check the archive bit for each file in a directory using python. So far i've got the following but i can't get it to work properly. The idea of the script is to be able to see all …

Refresh