Author Topic: Execution help  (Read 880 times)

Can somebody give me a way to quickly execute an entire folder? Like say exec("./Bricks/");.

exec("Add-Ons/AddOnCat_AddOnName/server.cs");
Like that. Or if you don't want to put a bunch of execs in one file, try this:

Code: [Select]
function execFolder(%filepath) {
for(%file = findfirstfile(%filepath @ "/*.cs"); %file !$= ""; %file = findnextfile(%filepath @ "/*.cs"))
exec(%file);
}

And use execFolder("Bricks");

does execFolder("./Bricks/"); work?

1: You won't need the end / mark.
2: Just do the full thing.

you could execute a file which then executes the other ones

you could execute a file which then executes the other ones

exec("Add-Ons/AddOnCat_AddOnName/server.cs");
Like that.

Why are you always restating a previous poster, phflack? Always.

Why are you always restating a previous poster, phflack? Always.
i'm not, i'm saying to use one command once, instead of using a few different commands (changing the target to execute each time)

Can somebody give me a way to quickly execute an entire folder? Like say exec("./Bricks/");.

This isnt always a good idea.  you never know what might be in that folder.  And sometimes the files need to be run in a certian order.

why do you want to exec ALL files in a folder?

why do you want to exec ALL files in a folder?
Usually if I am always adding files to that folder and don't want to add a new exec line for every file.

Usually if I am always adding files to that folder and don't want to add a new exec line for every file.

Although I'd like to avoid the "Old Code" folder within it. I keep my old versions of code files in case any of the code I want to stop using might come in handy.

By the way, it's easy. :cookieMonster: