ruby copy file

# Step 1: Specify the source and destination file paths
source_file_path = "path/to/source_file.txt"
destination_file_path = "path/to/destination_file.txt"

# Step 2: Open the source file in read mode
source_file = File.open(source_file_path, "r")

# Step 3: Read the content of the source file
file_content = source_file.read

# Step 4: Close the source file
source_file.close

# Step 5: Open the destination file in write mode
destination_file = File.open(destination_file_path, "w")

# Step 6: Write the content to the destination file
destination_file.write(file_content)

# Step 7: Close the destination file
destination_file.close