Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2022-12-02 13:49:53



Reply to topic  [ 2 posts ] 
EDITED: Allow sub-directories in #include file names 
Author Message

Joined: 2022-08-20 21:12:40
Posts: 1
Reply with quote
In LSL, #include doesn't seem to allow paths in subdirectories in Windows 11. Given the following files:

~/Documents/LSL Includes/Test/Hello.lsl:
Code:
default
{
    state_entry()
    {
        llOwnerSay("Hello, world!");
    }
}

~/Documents/LSL Includes/World.lsl:

Code:
#define HELLO_WORLD "Hello, world!"


And a script in my inventory:
Code:
#pragma include-from: ~/Documents/LSL Includes/
#include "Test/Hello.lsl"

... gets me the error message "Failure to include: Test/Hello.lsl".

This happens both in objects and in my inventory, with "./Test/Hello.lsl", <Test/Hello.lsl> and variants, with and without the trailing slash in the include-from, and so on. It does find the file when the include-from is "~/Documents/LSL Includes/Test" and the #include is for "Hello.lsl", which is therefore an obvious workaround, but not when the #include is "./Hello.lsl".


2022-08-21 04:56:57
Profile

Joined: 2009-03-17 18:42:51
Posts: 5093
Reply with quote
This is the expected bevhaviour, i.e. #include only currently accepts file names without any sub-directory path. It also applies to Lua #includes.

This is because file names are sanitized to forbid any attempt to "climb-up" the directory tree and load forbidden files (such as system files).

However, I do acknowledge the usefulness of sub-directories for large projects, so this feature (sub-directories support in #included file names) will be part of next release.


2022-08-21 12:30:57
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.