Iaan

Import all files in meta

14 posts in this topic

Hello everyone

Today I was thinking of a pro idea in the "meta.xml" file.

<file src = "images/*" />

The "*" represents all archives. (Loop)

 

When I do this, everything in the resource, in the folder "images" will be imported automatically, avoiding to write each file.

12 people like this

Share this post


Link to post

Good idea, this would save a lot of time. If it can be done.

Share this post


Link to post

Posted (edited)

Same could be done with any other files (scripts, maps), to be honest, not just file...files.

At the moment we can do this but it will require a separate watch script to implement the functionality.

Edited by myonlake

Share this post


Link to post

Posted (edited)

Good idea, but I would do asterisk substitute for any characters also. For example:

*.txd - all files with txt extension

file_*.txd - file_1, file_2, file_3, etc

Edited by Dante383
2 people like this

Share this post


Link to post
7 minutes ago, Dante383 said:

Good idea, but I would do asterisk substitute for any characters also. For example:

*.txd - all files with txt extension

file_*.txd - file_1, file_2, file_3, etc

Of course, this is another nice example.

Share this post


Link to post

It would be useful. But in the meantime you could use this simple shell script (if running linux):

for name in *.png #will go through all pngs, use * for all files.
do
echo "<file src=\"/images/$name\" type=\"client\" />" #$name will get replaced with file names
done

Just put it in the same directory as the files and then run simply like: ./test.sh > list.txt

Then just copy it from list.txt to meta.xml.

Hopefully someone can find it useful if they're not familiar with shell scripting.

1 person likes this

Share this post


Link to post

It need to be . That saves a lot of time. But not "*" simple, if I just want some files like txd. "*.txd" or dff "*.dff".
Good idea anyway.

Share this post


Link to post

Sick idea tho. I agree with this suggestion

Share this post


Link to post

I don't think it's really required since it can be done with any other programming languages. Just google it, there are already a few of examples.

Share this post


Link to post
On 21/04/2017 at 07:29, ozulus said:

I don't think it's really required since it can be done with any other programming languages. Just google it, there are already a few of examples.

I know it, but, why not implement this ? It's something simple and very productive.

I use a script similiar: 

On 04/03/2017 at 23:10, MIKI785 said:

It would be useful. But in the meantime you could use this simple shell script (if running linux):


for name in *.png #will go through all pngs, use * for all files.
do
echo "<file src=\"/images/$name\" type=\"client\" />" #$name will get replaced with file names
done

Just put it in the same directory as the files and then run simply like: ./test.sh > list.txt

Then just copy it from list.txt to meta.xml.

Hopefully someone can find it useful if they're not familiar with shell scripting.

 

Share this post


Link to post

It actually is weird, 'cause in ACL.XML you can do this, but weirdly not in resource's .xml

Share this post


Link to post
On 4/21/2017 at 05:29, ozulus said:

I don't think it's really required since it can be done with any other programming languages. Just google it, there are already a few of examples.

What if I want to make a script that automatically detects files I place in a folder?  I can think of allot of ways this will come in handy.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.