Question
Is there a limit to the length of a file path string in a model setup file?
Answer
When the model engines reads the input from a setup file there is a limit to the length of string. The limit is typically 255 characters, but may be higher in certain cases (e.g. for map projections). If this limit is exceeded the model will not execute as the program fails to read the entire string.
Even if it is not apparent from the User Interface, it can happen that the resulting file path to an output result file becomes too long:
- If the Output file is defined as relative to the model setup, the output file will be saved in a subfolder (e.g. c:/My Models/Test setup/ModelSetup.m21fm – Result Files/output.dfsu) which will extend number of characters in the resulting file path.
- If the simulation is carried out using several subdomains (for MIKE FM) temporary output files will be generated with an extra extension such that the file name becomes 3-4 characters longer, e.g. Flow_WinterConditions_ApplyingTSmodule_p0.dfsu.
If the model cannot execute and gives an error message, e.g. ‘DFS Open Error’ or ‘Wrong file type’, the cause could be that a file string has become too long. To verify that this is indeed the problem open the log-file and view the file string used by the model engine.
An example is given below. This model simulation fails as the total number of characters in the resulting file path extends beyond 255 characters.
Photo and/or video tutorial
Further information
Software: General MIKE
Latest update:
Article ID:
Further information: links to Release Note, manuals, etc. These will NOT be included in the KB
Related articles: cross referencing

