X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



4789 Rate this article:
No rating

Resolving file name character case issues when calling routines

On UNIX, if you save a program file with mixed character cases in the name, such as MyProgram.pro, IDL will issue an error when you call the routine from the IDL command prompt. The error will look like this:

% Attempt to call undefined procedure/function: 'MYPROGRAM'.
% Execution halted at: $MAIN$

This Help Article explains why you encounter this error, discusses the file naming conventions and limitations of various platforms, and describes the proper way to name and call files on UNIX.

UNIX has a case-sensitive file system, while IDL commands are inherently case-insensitive. Although you are free to name a routine with any combination of character cases, IDL will fold all such names to uppercase. Hence, MyProgram is really MYPROGRAM.

During autocompilation of user-written routines on UNIX platforms, IDL converts the routine name to all lowercase characters, and searches for a file with that name. To do otherwise would require IDL to try all combinations of upper and lowercase letters when searching for a file. This would be slow. Also, more than one file with the same name but different combinations of character cases can exist on UNIX. So the intended file for IDL to use would not be obvious.

The proper practice to avoid this problem is to use all lowercase letters when naming a .pro file. This will eliminate confusion and ensure cross-platform code. If you save your program file with all lowercase characters in the name, such as myprogram.pro, IDL will find, compile, and execute the myprogram procedure successfully. Although one can get away with not using all lowercase letters under Microsoft Windows, this is considered to be bad practice because it will cause problems when users try to run the code on UNIX-based platforms.

Platforms and their naming conventions/limitations

Microsoft Windows
  • The ":" character is not allowed in a filename.
  • File names are case insensitive.

Unix/Linux

  • File names are case sensitive -- file.pro is different from File.pro.
  • When writing cross-platform applications, you should avoid using filenames that are different only in case.

MacOSX

  • As a Unix operating system, Mac OS X files are fully case sensitive.
  • This means that the following files are actually distinct and different files.
  1. MyProcedure.pro
  2. MYPROCEDURE.pro
  3. myprocedure.pro

Note:
You can compile and run a program with a mixed- or upper-case file name on a UNIX platform by using IDL’s .COMPILE or .RUN executive commands. However, it is better to always use lower-case file names.


Review on 12/31/2013 MM

Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »