Tcl Source Code

View Ticket
Login
2026-10-19
18:54 • Ticket [875545270d] tcl::CopyDirectory copying /a/a /x/a/a error status stil... artifact: f9d02b912d user: serhiy.storchaka
18:54 • Ticket [82049f96f8] file copy attempts to copy directory into itself status ... artifact: 616bbebb7e user: serhiy.storchaka
18:53
Fix [82049f96f8] and [875545270d]: [file copy] of a directory into itself recursed until the path wa... leaf check-in: c51f96d014 user: serhiy.storchaka tags: copy-into-itself
2017-09-14
05:57 • New ticket [875545270d] tcl::CopyDirectory copying /a/a /x/a/a error. artifact: 1a04e2d69d user: raymin

Ticket UUID: 875545270d5f38184be7e7c244c28f3d8c31d2d1
Title: tcl::CopyDirectory copying /a/a /x/a/a error
Type: Bug Created on: 2017-09-14 05:57:17
Submitter: raymin Assigned to: nobody
Subsystem: 38. Init - Library - Autoload Severity: Minor
Priority: 5 Medium Last modified: 2026-10-19 18:54:12
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 8.6.18, 9.0.5, 9.1.0
Description:
When I reading init.tcl, I think tcl::CopyDirectory may have a bug.
My test is:

% tcl::CopyDirectory copying /a/a /x/a/a
error copying "/a/a" to "/x/a/a": trying to rename a volume or move a directory into itself
User Comments:
serhiy.storchaka added on 2026-10-19 18:54:12:

Still present in 8.6, 9.0 and 9.1. The check uses [string first], so a target that only contains the source path somewhere is rejected. It matters for [file copy] between file systems (from zipfs or a VFS), which uses tcl::CopyDirectory. Proposed fix in branch copy-into-itself, together with [82049f96f8]: compare the [file split] prefix. Tests init-6.0 and 6.1.