Visit ComfyUI Online for ready-to-use ComfyUI environment
Efficiently copy and manage files based on patterns, with options for simulation, deletion, and detailed logs.
The CopyFiles| Copy Files 🐑 node is designed to facilitate the efficient transfer of files from one directory to another, based on specific file patterns. This node is particularly useful for organizing and managing large collections of files by allowing you to specify which files to copy using pattern matching. It offers the flexibility to either perform actual file operations or simulate them, providing a safe way to test the process before execution. Additionally, it can delete the original files after copying, helping to streamline file management tasks. This node is an essential tool for users who need to automate file handling tasks, ensuring that files are copied accurately and efficiently while providing detailed logs of the operations performed.
The source_directory
parameter specifies the path to the directory from which files will be copied. It is crucial as it defines the starting point for the file transfer operation. The default value is "X://path/to/source"
, and it should be set to the directory containing the files you wish to copy. This parameter does not have a minimum or maximum value but must be a valid directory path.
The destination_directory
parameter indicates the path to the directory where the files will be copied. It is essential for determining the target location for the copied files. The default value is "X://path/to/destination"
, and like the source directory, it must be a valid directory path. This parameter ensures that the copied files are organized in the desired location.
The pattern
parameter allows you to specify a file pattern to match, such as "*.txt"
. This parameter is vital for filtering which files should be copied based on their names or extensions. The default value is "*.txt"
, but it can be adjusted to match any file pattern you need. This parameter helps in selectively copying files that meet specific criteria.
The delete_origin
parameter is a boolean that determines whether the original files should be deleted after they are copied. The default value is False
, meaning the original files will remain in the source directory unless this parameter is set to True
. This option is useful for freeing up space in the source directory once the files have been successfully copied.
The mock
parameter is a boolean that, when set to True
, simulates the file copying process without actually performing any file operations. The default value is False
, meaning the node will execute the file operations unless this parameter is enabled. This feature is beneficial for testing and verifying the file transfer process without making any changes to the file system.
The copied_file_count
output parameter returns an integer representing the number of files that were successfully copied. This output is crucial for verifying the success of the file transfer operation and ensuring that the expected number of files have been processed.
The log
output parameter provides a detailed log message of the operations performed during the file copying process. This log includes information about each file copied, any errors encountered, and the overall success of the operation. It is an essential tool for tracking the process and diagnosing any issues that may arise.
pattern
parameter to filter files by type or name, ensuring only the desired files are copied.mock
parameter to test the file copying process without making any changes to your file system, allowing you to verify the operation before execution.delete_origin
to True
if you want to automatically clean up the source directory after copying, which can help manage disk space efficiently.<error_message>
<pattern>
' found in <source_directory>
.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.