Jump to content

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


photo

Recommended Posts

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?

Link to comment

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:

Link to comment

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

Link to comment

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:

Link to comment

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

Link to comment

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

Link to comment
×
×
  • Create New...