Skip to content

Commit

Permalink
Revert "Reverted hardcoding of separator merged with previous PR."
Browse files Browse the repository at this point in the history
This reverts commit 0c3c270.
  • Loading branch information
psuter committed Nov 20, 2012
1 parent 0c3c270 commit db23b42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/z3/Z3Wrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* mostly through the other classes, though. */
public final class Z3Wrapper {
// related to the path in the jar file
private static final String LIB_SEPARATOR = System.getProperty("file.separator");
private static final String LIB_SEPARATOR = "/";
private static final String LIB_BIN = LIB_SEPARATOR + "lib-bin" + LIB_SEPARATOR;
// the root name of the library file. lib....so in Linux, lib....jnilib in MacOS, ....dll in Windows, etc.
private static final String LIB_NAME = "scalaz3";
Expand Down Expand Up @@ -67,7 +67,7 @@ private static void loadFromJar() {
private static void loadLib(String path, String name, boolean optional) {
name = System.mapLibraryName(name);
String completeFileName = LIB_BIN + name;
File fileOut = new File(System.getProperty("java.io.tmpdir") + LIB_SEPARATOR + path + completeFileName);
File fileOut = new File(System.getProperty("java.io.tmpdir") + "/" + path + completeFileName);
//System.out.println("I'll be looking for the library as: " + fileOut);

if(fileOut.isFile() && fileOut.canRead()) {
Expand Down

2 comments on commit db23b42

@vo1stv
Copy link
Contributor

@vo1stv vo1stv commented on db23b42 Nov 25, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious what the issue was here. Does System.getProperty("file.separator"); fail under certain operating systems?

@psuter
Copy link
Member Author

@psuter psuter commented on db23b42 Nov 25, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is in how jar resources are accessed. You can take a look at the discussion around this pull request.

I suppose a cleaner solution would be to construct separate paths for the lib when accessed as a file or as a jar resource.

Please sign in to comment.