Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why do filenames that work on the Windows version sometimes don work on UNIX?

filenames Unix version Windows
0
Posted

Why do filenames that work on the Windows version sometimes don work on UNIX?

0

The path separator character is a backslash character “\” on Windows and a foreslash aka divide character “/” on UNIX. So “\\xb\\xxx\\entry.xxx” and “/xb/xxx/entry.xxx” are valid filenames for Windows and UNIX respectively. Remember, a single backslash character is represented by two backslashes in literal strings. To make source programs as portable as possible, standard library functions and the OPEN() intrinsic accept filenames with either separator. These functions call XstPathString$() to convert every improper separator to the proper separator before they continue. To make sure you avoid potential filename problems, however, substitute the $$PathSlash$ constant defined in the standard library for every occurrence of the literal separator character. Alternately, call XstPathString$() to convert filename strings into the correct format. This function takes either form and returns a valid path string for the current system. XstPathString$() also expands environment variables. “$HOME

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.