Tcl Source Code

View Ticket
Login
Ticket UUID: 82049f96f841214bb8cee18e1bf8f84aa25ed9aa
Title: file copy attempts to copy directory into itself
Type: Bug Version: 8.6
Submitter: anonymous Created on: 2018-11-21 14:06:54
Subsystem: 37. File System Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2018-11-21 14:06:54
Resolution: None Closed By: nobody
    Closed on:
Description:
Tcl's "file copy" functionality attempts to copy a directory into itself.  Like:

$ mkdir 1
$ mkdir 1/2
$ tclsh
% file copy 1 1/2
error copying "1" to "1/2/1": "1/2/1/2/1/2[long string deleted]": file name too long

Other, similar programs seem to check the inodes of the path to ensure directories don't get copied into themselves:

$ mkdir 1
$ mkdir 1/2
$ cp -r 1 1/2
cp: cannot copy a directory, '1', into itself, '1/2/1'