From: Angel H. <ang...@ua...> - 2007-10-04 13:45:21
|
El 4 Oct 2007 a las 17:25, sushil ronghe escribi=F3: > OOPs the code > viewer.script("pmesh me \""+file.getAbsolutePath() + "\""); > works fine on linux but it is giving the error on windows. > file not found. > > suppose the file location is D:\myWork\files\MESHDATA.txt > then the error message =3D> file not found:D:myWorkfilesMESHDATA.txt The commas business tends to be messy when a combination of Javascript, JmolScript etc is used. But now it seems that in your case the backslash is being taken as an escape character and so ignored. I imagine two possible solutions: 1 (best): do not use backslash \ but forward slash /, it's more cross-platform in HTML. 2: maybe, use double backslashes \\ It all depends on which scripting languages your code is going through; I don't think I can be more specific. It seems that your file.getAbsolutePath() comes straight from... Java? Javascript? (I'm lost here) and Windows is messing it up. If you cannot control its output, at least you should be able to parse it through a function that replaces all "\" by "/", before giving it to viewer.script Good luck |