You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support automatically adapting to set the encoding format according to the IO stream when performing IO operations on file; Update file:Add encoding data to property<info> of class<File>.
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ pip install easierfile
21
21
## 🔗Dependencies
22
22
23
23
-[Dynoptimdict - A dynamic data dict class that inherits and overrides the built-in dict class for special purposes. That provides real-time access to dynamic data, while still allowing the option to get only the specified data without calculating all. It adheres to the concept of program optimization which avoids loading if not used, saving both memory and time](https://github.com/leoweyr/Python-Dynoptimdict)
24
+
-[Chardet - The universal character encoding detector](https://github.com/chardet/chardet)
<td>Return a dict of file attribute information.</br>● path: the absolute path of the file</br>● dir_path: the absolute path of the directory where the file is located</br>● full_name: the name of the file</br>● name: the name of the file without file extension</br>● ext: the extension of the file</td>
24
+
<td>Return a dict of file attribute information.</br>● path: the absolute path of the file</br>● dir_path: the absolute path of the directory where the file is located</br>● full_name: the name of the file</br>● name: the name of the file without file extension</br>● ext: the extension of the file</br>● encoding: the encoding of the file</td>
25
25
</tr>
26
26
<tr>
27
27
<td><code>File().status</code></td>
28
28
<td>Return a dict of file status information.</br>● file_lock: whether file lock is on</br>● exist: whether the file exist</td>
raiseFileNotFoundError("File was about to be occupied, but not found: "+self.__m_info["path"])
70
+
raiseFileNotFoundError("File was about to be occupied, but not found: "+self.__m_static_info["path"])
69
71
else:
70
-
raiseFileNotFoundError("File was about to be unoccupied, but not found: "+self.__m_info["path"])
72
+
raiseFileNotFoundError("File was about to be unoccupied, but not found: "+self.__m_static_info["path"])
71
73
72
74
defcreate(self):
73
75
ifnotself.status["exist"]:
74
-
ifnotos.path.exists(self.__m_info["dir_path"]): # Create the file directory if it doesn't exist, so that code<open()> doesn't throw the exception.
75
-
os.mkdir(self.__m_info["dir_path"])
76
+
ifnotos.path.exists(self.__m_static_info["dir_path"]): # Create the file directory if it doesn't exist, so that code<open()> doesn't throw the exception.
77
+
os.mkdir(self.__m_static_info["dir_path"])
76
78
try:
77
-
file_temp=open(self.__m_info["path"], "x")
79
+
file_temp=open(self.__m_static_info["path"], "x")
78
80
exceptFileExistsError: # Avoid exception caused by creating corresponding file in other ways during program execution intervals.
0 commit comments