Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Lars Christensen
RE: Dir.getwd returning temporary directory [ reply ]  
2009-08-11 07:39
OCRA 1.1.2 which was just released yesterday now sets an OCRA_EXECUTABLE environment variable to point to where the .exe. You can use this to obtain the path.

By: Lars Christensen
RE: Dir.getwd returning temporary directory [ reply ]  
2009-07-04 09:03
Ocra does not change the current directory, but leaves it at whatever it was when the .exe was run. This can be the same directory, or some other directory depending on how the .exe was invoked (through explorer, from command line, or through a file association - all yield different current working directories).

C:\somepath>type getwd.rb
puts Dir.getwd


C:\somepath>ocra getwd.rb
...
=== Finished (Final size was 513110)

C:\somepath>getwd.exe
C:/somepath

I can see the need for having a way to obtain the full path of the .exe, no matter how it was invoked (I think this is what you are asking for). This is what was requested in ticket #26049.

By: Muriel Salvan
Dir.getwd returning temporary directory [ reply ]  
2009-06-29 14:40
Greetings

It seems Ocra changes the current directory where your app is executed.
This can seem logical as it points to the new path where your source files are unzipped, but sometimes you need to get the directory where your binary was invoked from.

I am especially suffering from this, as my app is built upon a plugins engine: the static core of the app is built in Ocra, and plugins are made of satellite .rb files not part of the Ocra binary (and I don't want to put them in there). Therefore I need to get the current directory where my binary and my plugin files are stored, not the temporary directory.

Do you have any idea how I can achieve this ?

Thanks,

Muriel