Jump to content

[SOLVED] running system() from a specific location on windows.


photo

Recommended Posts

Posted

I am trying to use system() along side ung to export out a project and compress it.

The following line on Linux works brilliantly

cd /path/to/current/unigine/project/data/; ung -o /path/to/issued/unigine/project/data/core.ung -d core

where ung_x64 has been renamed to ung and put in my path

on windows I tried 

cd C:\\Path\\to\\current\\unigine\\project\\data\\ & ung.exe -o C:\\Path\\to\\issued\\unigine\\project\\data\\core.ung -o core

as it seems to get ung to address files correctly in the archive it needs to be run from inside data. 

Anybody have any ideas on what I can do about this?

Posted

Hi,

 

You can try to put ung tool inside your project directory (before data folder) and run following commad:

 

  • ung -d data\core -o core.ung

 

This command will generate ung archieve with contents of data\core.

If you run ung -e core.ung it will unpack files to the data\core folder.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

I will need to store the ung files in the base folder right? Will these be picked up when the engine runs?

ok I will run with that for the moment. But I would still like to know if I can achieve the above

Posted

I will need to store the ung files in the base folder right? 

 

If you add ung tool to the PATH variable you will not need to copy it everytime. Just run same command from the desired directory:

  • cd C:\project\dir & ung -d data\core -o core.ung

As a result core.ung file will be generated at C:\project\dir\core.ung with contents of C:\project\dir\data\core folder.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

If you add ung tool to the PATH variable you will not need to copy it everytime. Just run same command from the desired directory:

  • cd C:\project\dir & ung -d data\core -o core.ung

 I have ung in my path -> this is precisely the command line that isn't working for me under windows at the moment. The equivelent command under windows works fine

 

It's worth noting that the command works fine from a terminal window but not from the system() call

Posted

thankyou - that was exactly the sort of thing I was looking for

Posted

I take that back still not working for me

 

system("cmd.exe /k \"cd /d C:/path/to/data/dir & dir\"");[\code]

 

gives me a directory listing from the bin folder

Posted

What version of windows are you using? Did you try to replace "&" with "&&"?

Also, it would be good to know full path to your data dir - does it contains unicode symbols or spaces?

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

sorry found issue - almost there... probably one more question coming up

Posted

ok so running /c rather than /k is needed otherwise unigine hangs. Its all definately working now thankyou

×
×
  • Create New...