-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Is your feature request related to a problem? Please describe.
Currently, if I want to append a new line of text to an existing .txt file using this tool, there only have wirte_file now.
Describe the solution you'd like
I would like a new tool to be added, named append_file or append_wirte_file. This function should perform the following actions:
Accept two main arguments: the path to the target text file and the string content to be appended. Write the provided string content to the end of the file.
Crucially, automatically add a newline character (\n or the appropriate OS-specific newline) after the appended content. This ensures that each call to this function adds the content on a new line, making subsequent appends also start on a fresh line.
Handle the closing of the file automatically and safely.
Describe alternatives you've considered
None.
Additional context
None.