Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Relative path to wwwroot for C++ Builder
#6
As MJS pointed out, the article explains how relative and absolute URL paths are resolved when serving content from the IntraWeb server, not how to access a particular file using the OS file system.

The short answer is: You cannot safely use a relative path to access a file on your hard disk. Always use the full path to the file.

The longer answer is:  In the Windows file system, a relative path is always defined relative to the current working directory. However, the current working directory cannot be safely determined in a multi-threaded application because any thread could possibly change it.
In Windows, the current directory is a property of the process, not of individual threads. This means that if one thread changes the current directory, it affects all threads within the same process.
IntraWeb itself won't change the current working directory but many 3rd party frameworks do.
Reply


Messages In This Thread
RE: Relative path to wwwroot for C++ Builder - by Alexandre Machado - 07-29-2024, 10:13 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)