@@ -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 ):
@@ -141,24 +132,6 @@ def delete_files_and_subfolders(directory):
141132 total_folders_deleted += 1
142133
143134
144- def copy_file (source_path , destination_path ):
145- # Ensure the destination directory exists
146- os .makedirs (os .path .dirname (destination_path ), exist_ok = True )
147-
148- # Open the source file in read-binary ('rb') mode
149- with open (source_path , "rb" ) as source_file :
150- # Open the destination file in write-binary ('wb') mode
151- with open (destination_path , "wb" ) as destination_file :
152- # Copy the content from source to destination
153- while True :
154- # Read a chunk of the source file
155- chunk = source_file .read (4096 ) # Reading in chunks of 4KB
156- if not chunk :
157- break # End of file reached
158- # Write the chunk to the destination file
159- destination_file .write (chunk )
160-
161-
162135def add_current_path_if_no_path (filename ):
163136 # Extract the base name of the file (ignoring any path information)
164137 basename = os .path .basename (filename )
0 commit comments