UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 23438

Tcl - Creating a new project through Tcl command (e.g., project new c:\test) causes "ERROR:HierarchicalDesignC:43 - Can't open project file"

Description

When I create a new project through the Tcl Console in Project Navigator or the Xilinx Tcl shell (xtclsh), the following error occurs:

"ERROR:HierarchicalDesignC:43 - Can't open project file ... "

Example:

'project new c:\test.ise' is entered in the Tcl console resulting in the following error messages:

ERROR:HierarchicalDesignC:43 - Can't open project file "c: est.ise".
ERROR:HierarchicalDesignC:51 - Failed to open Project repository. Cannot load HDProject data.
ERROR:HierarchicalDesignC:40 - Failed to close Project repository. HDProject data may not have been properly written to the Project file.

NOTE: In the error message, the back slash in the project directory path has been removed.

Solution

Windows

In general, either slashes or backslashes are accepted by Microsoft applications to be exactly equivalent to one another as input. Where possible, the Xilinx design tools follow this standard. Some command line applications, particularly shell interpreters, are limited in their use of slashes. The Xilinx standard of preferring to use and display the backslash character is modified in situations where it cannot be directly used by the application. A notable example of this exception is the Xilinx Tcl command interpreter. The Tcl command interpreter used by Xilinx applications is tclsh with Xilinx package extensions. Tclsh accepts either a single slash character or a double backslash character as the path component separator. A single backslash is treated as an escape character. Note that in the example above '\t' from 'c:\test.ise' is treated as a TAB character.

On way to solve this problem caused by backslash characters in a directory path is to isolate the path using curly brackets as in the following example.

project new {c:\test}

Xilinx design tools support the use of both drive-relative and UNC-style names. Both / and \\ can be used as directory separators in either type of name. Drive-relative names consist of an optional drive specifier, followed by an absolute or relative path. UNC paths follow the general form, as show below:

\\servername\\sharename\\path\\file. Xtclsh accepts both drive-relative and UNC entry of path names.

To avoid path separator issues when using Tcl commands, you may always use the UNIX-style path and drive designation (see below).

In both forms, the file names . and .. are special and refer to the current directory and the parent of the current directory respectively. The following examples illustrate various forms of path names that may be entered by a user in either a dialog box or in a text-based input file:

\\Host\share\file Absolute UNC path to a file called file in the root directory of the export point share on the host Host - Do not use in a Tcl shell
//Host/share/file Absolute UNC path to a file called file in the root directory of the export point share on the host Host
\/Host\share/file Absolute UNC path to a file called file in the root directory of the export point share on the host Host - Do not use in a Tcl shell

c:foo Volume-relative path to a file foo in the current directory on drive c
c:\foo Absolute path to a file foo in the root directory of drive c - Do not use in a Tcl shell
c:/foo Absolute path to a file foo in the root directory of drive c
foo\bar Relative path to a file bar in the foo directory in the current directory on the current volume - Do not use in a Tcl shell
\foo Volume-relative path to a file foo in the root directory of the current volume - Do not use in a Tcl shell

Unix

On Unix platforms, the components of a path name are separated by forward slashes. Path names may be relative or absolute. The file names . and .. are special and refer to the current directory and the parent of the current directory respectively. Multiple adjacent slash characters are interpreted as a single separator. The following examples illustrate various forms of path names:

/ Absolute path to the root directory
/etc/passwd Absolute path to the file named passwd in the directory etc in the root directory
. Relative path to the current directory
foo Relative path to the file foo in the current directory
foo/bar Relative path to the file bar in the directory foo in the current directory
../foo Relative path to the file foo in the directory above the current directory
AR# 23438
Date Created 09/04/2007
Last Updated 02/25/2011
Status Archive
Type General Article