@@ -54,15 +54,6 @@ def is_system_folder_path(file_path: str) -> bool:
5454 return bool (parts ) and parts [0 ] in SYSTEM_FOLDERS
5555
5656
57- def get_file_type (file_name ):
58-
59- # Extract the file extension
60- ext = Path (file_name ).suffix .lower () # Convert to lowercase to handle case-insensitive matching
61-
62- # Use the dictionary to get the file type, defaulting to 'unknown' if the extension is not found
63- return FILE_EXTENSION_MAPPING .get (ext , "unknown" )
64-
65-
6657def list_all_text_files (directory ):
6758 all_files = []
6859 for root , dirs , files in os .walk (directory , topdown = True ):
@@ -124,24 +115,6 @@ def delete_files_and_subfolders(directory):
124115 os .remove (entry .path )
125116
126117
127- def copy_file (source_path , destination_path ):
128- # Ensure the destination directory exists
129- os .makedirs (os .path .dirname (destination_path ), exist_ok = True )
130-
131- # Open the source file in read-binary ('rb') mode
132- with open (source_path , "rb" ) as source_file :
133- # Open the destination file in write-binary ('wb') mode
134- with open (destination_path , "wb" ) as destination_file :
135- # Copy the content from source to destination
136- while True :
137- # Read a chunk of the source file
138- chunk = source_file .read (4096 ) # Reading in chunks of 4KB
139- if not chunk :
140- break # End of file reached
141- # Write the chunk to the destination file
142- destination_file .write (chunk )
143-
144-
145118def add_current_path_if_no_path (filename ):
146119 # Extract the base name of the file (ignoring any path information)
147120 basename = os .path .basename (filename )
0 commit comments