OpenCL include path with spaces

Hi!
I tried passing additional include paths to the clBuildProgram(...) function using "-I dir" as given in the specification. This works perfect as long as the directory name given does not contain any spaces. However on some platforms you cannot avoid the path to contain spaces, so the application needs to be able to handle this. Did anybody figure out a way to pass directory names containing spaces in a way that the Apple implementation can handle? The AMD implementation understands using -I "dir". Sadly that syntax will break the Apple implementation. Did you find another way?

after change the "PATH" on Windows you need to restart the machine.

Similar Messages

  • Tomcat as service : install path with spaces

    I'm trying to install tomcat as service
    but when I choose an install path with spaces
    I mean smthing like "c:\program files\tomcat"
    it doesn't work
    I tried to modify the wrapper.properties file
    with "" but it doesn't work
    I even set the parameter wrapper.cmd_line with
    a command line that works when launched for CMD
    but the service doesn't start
    any idea????

    I found it ! (hope it helps)
    wrapper.properties that works with spaces in the name
    of the java directory and the tomcat directory
    # $Header: /home/cvs/jakarta-tomcat/src/etc/Attic/wrapper.properties,v 1.2.2.1 2000/10/16 01:59:22 larryi Exp $
    # $Revision: 1.2.2.1 $
    # $Date: 2000/10/16 01:59:22 $
    # jk_service.properties - a bootstrup file for the Tomcat NT service.
    # This file provides jk_nt_service with the needed information to
    # start tomcat at a different process.
    # As a general note, the characters $( and ) are used internally to define
    # macros. Do not use them!!!
    # Whenever you see a set of lines such as:
    # x=value
    # y=$(x)\something
    # the final value for y will be value\something
    # Normaly all you will need to modify is the first two properties, i.e.
    # wrapper.tomcat_home and wrapper.java_home. Most of the configuration
    # is derived from these two.
    # wrapper.tomcat_home should point to the location where you
    # installed tomcat. This is where you have your conf, webapps and lib
    # directories.
    wrapper.tomcat_home=C:\Program Files\tomcat-3.2.1
    # wrapper.java_home should point to your Java installation. Normally
    # you should have a bin and lib directories beneath it.
    wrapper.java_home=C:\Program Files\JavaSoft\JRE\1.3
    #------ ADVANCED MODE ------------------------------------------------
    # Make sure that you read the how-to before making too many changes.
    # Defining where the service is going to put the standard
    # output of Tomcat. This is where System.out.println and
    # System.err.println goes to.
    wrapper.stdout=$(wrapper.tomcat_home)\logs\jvm.stdout
    wrapper.stderr=$(wrapper.tomcat_home)\logs\jvm.stderr
    # Additions to the path. put here directories where you store DLLs for
    # native methods etc.
    wrapper.ld_path=d:\
    wrapper.ld_path=c:\
    # Defining the classpath. All the rows that belongs to the class_path
    # property are concatenated to create the classpath for Tomcat.
    # If you have additional locations that you would like to add to the
    # claspath you should add a new wrapper.class_path=<location> line.
    wrapper.class_path="$(wrapper.tomcat_home)\classes"
    wrapper.class_path="$(wrapper.tomcat_home)\lib\jaxp.jar"
    wrapper.class_path="$(wrapper.tomcat_home)\lib\parser.jar"
    wrapper.class_path="$(wrapper.tomcat_home)\lib\webserver.jar"
    wrapper.class_path="$(wrapper.tomcat_home)\lib\servlet.jar"
    wrapper.class_path="$(wrapper.tomcat_home)\lib\jasper.jar"
    # This is where Javac is located in JDK1.2.x
    wrapper.class_path="$(wrapper.java_home)\lib\tools.jar"
    # and a tribute to JDK1.1.x
    wrapper.class_path="$(wrapper.java_home)\lib\classes.zip"
    # This is the Java interpreter used for running Tomcat
    wrapper.javabin=$(wrapper.java_home)\bin\java.exe
    # This is Tomcat's startup class (the class that contains Tomcat's
    # starting point.
    wrapper.startup_class=org.apache.tomcat.startup.Tomcat
    # This is the location where tomcat's server.xml configuration file
    # is located.
    wrapper.server_xml=$(wrapper.tomcat_home)\conf\server.xml
    # The NT service uses AJP12/AJP13 to shutdown Tomcat. The
    # wrapper.shutdown_port tells the service the identity of the port that
    # is used by AJP12/AJP13.
    wrapper.shutdown_port=8007
    # Can either be ajp12 or ajp13 depending on your configuration.
    # Default value is ajp12
    wrapper.shutdown_protocol=ajp12
    # This is the command line that is used to start Tomcat. You can add extra
    # parameters to it but you can not remove anything.
    wrapper.cmd_line="$(wrapper.javabin)" -classpath $(wrapper.class_path) $(wrapper.startup_class) -config "$(wrapper.server_xml)" -home "$(wrapper.tomcat_home)"

  • How do I enter a path with spaces

    In creating a special mail alert there is an option to enter a file to execute. If I put the file in my C;/Program Files (86)... it wont execute because of the spaces. How do I enter the path and filename with spaces. YES, I have tried all sorts of "s and they don't seem to work. Can you give an example.

    I usually find that if use the offered option to browse to the file using the browser/picker provided, all this is taken care of. Thunderbird will use a technique widely emplyed on the web, where spaces are encoded as %20. Other potentially troublesome characters such as slashes and colons will get similar treatment.
    As an aside, 20 is hexadecimal for the decimal value 32, which is the standard value in ASCII and many other encodings for the space character. So %20 is a particular notation that advises that the character with hexadecimal value 20 is to be used.
    In general "C:\Program Files\example\example.txt" ought to work too.
    But your problem may be specific to the particular context. I have had a long standing issue where I want to send a link to a file on a shared network drive and the link sent via Thunderbird has refused to work as an active link. The recipient generally had to copy and paste the provided pathname. This seems to have resolved itself in a recent update of Thunderbird. If you're using an add-on then the problem may be inherent in that add-on, or in a rather obscure difficulty with giving the Thunderbird process access permission to work with local files.

  • Creation of file that have path with spaces (on aplication server)

    Hello all,
    Does anybody know how to do this? When I try to save save file with path like
    '/usr/sap/some dir/file.txt' than '/usr/sap/some' is being created (everything after first space is being cut). What should I do?

    Hi Marcin,
    you may surround the path with quotes ('').
    I hope it helps. Best regards,
    Alvaro

  • How to run cdb -c with a command that contains paths with spaces?

    CDB has a -c command line option that runs a specified command, sort of like
    cmd -c, I suppose. Here's what I need to run:
    cdb.exe -c "!itoldyouso \"c:\Program Files (x86)\My Software\1.exe\" \"c:\Development\my-software\bin\1.pdb\";q" "notepad.exe"
    Note that here I've tried escaping quotes around paths with \. No luck. I've also tried
    ^ and """ (triple quote). All I get is this:
    0:000> cdb: Reading initial command '!itoldyouso "c:\Program Files (x86)\My Software\1.exe" "c:\Development\my-software\bin\1.pdb";q'
    c:Program - ignored. The input name/address could not be resolved to a loaded module.
    Files - ignored. The input name/address could not be resolved to a loaded module.
    (x86)My - ignored. The input name/address could not be resolved to a loaded module.
    Software1.exe - ignored. The input name/address could not be resolved to a loaded module. Could not find module c:program ^ Extra character error in '!itoldyouso "c:\Program Files (x86)\My Software\1.exe" "c:\Development \my-software\bin\1.pdb";q'
    The command is passed to CDB correctly, but CDB itself doesn't know how to parse quotes.

    Hmm,
    !itoldyouso with spaces in path does not even work, when started inside cdb or windbg for me.
    But something like this reports success:
    cdb.exe -c ".reload /f /i \"'C:\Users\sammy\Documents\Visual Studio 2010\Projects\DebuggerStub\Debug\DebuggerStub.
    exe'=0x6000000,0x1b000\"" notepad.exe
    Microsoft (R) Windows Debugger Version 6.3.9431.0 X86
    Copyright (c) Microsoft Corporation. All rights reserved.
    CommandLine: notepad.exe
    ************* Symbol Path validation summary **************
    Response Time (ms) Location
    OK C:\Users\sammy\Documents\Visual Studio 2010\Projects\DebuggerStub\De
    bug
    OK C:\Windows\symbols\dll
    Deferred srv*C:\Symbols\MsSymbols*http://msdl.microsoft.com/download/symbols
    Symbol search path is: C:\Users\sammy\Documents\Visual Studio 2010\Projects\DebuggerStub\Debug;C:\Windows\symbols\d
    ll;srv*C:\Symbols\MsSymbols*http://msdl.microsoft.com/download/symbols
    Executable search path is:
    ModLoad: 007c0000 007e8000 notepad.exe
    ModLoad: 77540000 77668000 ntdll.dll
    ModLoad: 77460000 7753d000 C:\Windows\system32\kernel32.dll
    ModLoad: 75c70000 75d36000 C:\Windows\system32\ADVAPI32.dll
    ModLoad: 75f60000 76022000 C:\Windows\system32\RPCRT4.dll
    ModLoad: 75ed0000 75f1c000 C:\Windows\system32\GDI32.dll
    ModLoad: 77680000 7771d000 C:\Windows\system32\USER32.dll
    ModLoad: 761d0000 7627a000 C:\Windows\system32\msvcrt.dll
    ModLoad: 77720000 77793000 C:\Windows\system32\COMDLG32.dll
    ModLoad: 75c10000 75c69000 C:\Windows\system32\SHLWAPI.dll
    ModLoad: 749c0000 74b5e000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.1830
    5_none_5cb72f2a088b0ed3\COMCTL32.dll
    ModLoad: 76920000 77431000 C:\Windows\system32\SHELL32.dll
    ModLoad: 6f750000 6f792000 C:\Windows\system32\WINSPOOL.DRV
    ModLoad: 76310000 76455000 C:\Windows\system32\ole32.dll
    ModLoad: 76280000 7630e000 C:\Windows\system32\OLEAUT32.dll
    (fc8.1738): Break instruction exception - code 80000003 (first chance)
    eax=00000000 ebx=00000000 ecx=0015fa34 edx=775a5b44 esi=fffffffe edi=00000000
    eip=775886ce esp=0015fa4c ebp=0015fa7c iopl=0 nv up ei pl zr na pe nc
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
    ntdll!DbgBreakPoint:
    775886ce cc int 3
    0:000> cdb: Reading initial command '.reload /f /i "'C:\Users\sammy\Documents\Visual Studio 2010\Projects\DebuggerS
    tub\Debug\DebuggerStub.exe'=0x6000000,0x1b000"'
    *** WARNING: Unable to verify timestamp for 'C:\Users\sammy\Documents\Visual Studio 2010\Projects\DebuggerStub\Debu
    g\DebuggerStub.exe'
    0:000> lm
    start end module name
    007c0000 007e8000 notepad (deferred)
    06000000 0601b000 DebuggerStub M (private pdb symbols) c:\users\sammy\documents\visual studio 2010\projects\debuggerstub\debug\DebuggerStub.pdb
    6f750000 6f792000 WINSPOOL (deferred)
    So a backslash looks not so bad, else one can try to use a script-file with "-c" arg. 
    With kind regards

  • UNIX path AND  Do shell script path with spaces

    I am trying to building a interface with buttons to execute shell commands when the button is pressed. Below press button execute code.
    I am new to AppleScript and Xcode and Interface builder. I have read different post referencing spaces but I still don't understand.
    THIS COMMAND DOESN'T WORK IT'S SOMETHING TO DO WITH SPACES.
    How would I fix this to work.
    on clicked theObject
    do shell script "rm /Library/Preferences/com.netopia.netOctopus\ Agent.preferences"
    end clicked
    This works (Below) no spaces in the path
    on clicked theObject
    do shell script "open /System/Library/PreferencePanes/SharingPref.prefPane/"
    end clicked
    ALL Mac OS X (10.4.6)
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.8)  
    ALL   Mac OS X (10.4.8)  

    Camelot's explanation was good, but you don't seem to get it, so I'll take a crack at explaining as well.
    First off, you need to understand what "do shell script" does and does not do. "do shell script" takes a string from AppleScript and passes it to a shell interpreter. It does not check in advance that this string makes sense. (That is impossible to do, in fact.) It just passes it along. The shell interpreter then converts the string into a command, or series of commands, and attempts to run them.
    In AppleScript, quotation marks around something make that something a string. So, for example:
    "rm "
    is a string containing a letter r, a letter m, and then a space. Some commands can also return a string, which can then be stored in a named variable, as for example:
    set a_variable to (the text returned of display dialog "Hi!" default answer "Some text")
    When you wish to put two strings together in AppleScript, you use the & operator, as in:
    "String 1" & "String 2"
    In this example, there is no space at the end of the first string, and none at the beginning of the second, so the result is:
    "String 1String 2"
    All clear so far?
    When a shell interpreter attempts to convert a string into commands, it has to split the string into pieces. A space signifies a break between pieces. In order to put a space into a single item, you can do a number of things. You can put the whole item in quotation marks (single or double), which is known as "quoting":
    '/A/Path/With/A Space'
    or you can put a backslash before the space, which is known as "escaping":
    /A/Path/With/A\ Space
    You can combine quoting and escaping if you do it right. For example, the backslash also lets you use a quotation mark inside a single item which is quoted:
    "/A/Path/With/A Space/And/A\"Quotation/Mark"
    There are further rules and substitutions that sometimes border on the arcane.
    In order to simplify things, Apple created the command "the quoted form of". This command takes a string and returns a new string which is properly set up so that it will be just one item when split up for the command line. It will add quotation marks, backslashes, or whatever.
    So, to put things together:
    "rm " & the quoted form of thePath
    is a way of saying to AppleScript "take the string in the variable named thePath, and quote it for the command line; then stick it on the end of a string containing an r, an m, and a space."
    When you pass this to "do shell script", it will break things up in such a way that it hands thePath to the rm command, which will attempt to remove whatever is represented by thePath. (Adding the "-r" in there just tells the rm command "if this is a directory, get rid of it and all its contents". Otherwise rm will complain if the item is a directory.)
    I think, however, you may just have the path wrong. In one of the spots where you gave the POSIX path, it had a backslash (\) at the end instead of a forward slash (/). As Camelot says, a forward slash means that the item is a directory and not a plain file. But if you really meant the backslash, it suggests that the item is a plain file, but has a space at the end (or some other character that mystifies the command line). It's an escape.
    Try making a new script in Script Editor which says
    ">" & (the POSIX path of (choose file)) & "<" at the end, that's the culprit.
    (And if it won't let you select the file when you run the script, it means that the item is actually a folder.)

  • Unable to access files with spaces in the path

    Hi all, I am accessing files which reside on the server using a java applet.
    The typical path of a file could be:
    http://192.168.0.2/agat/data/AF190701 0003.agt
    (not the space in the filename).
    When I try to open this file using a URL object:
    URL file = new URL(filename);
    BufferedReader in = new BufferedReader(new InputStreamReader(file.openStream()));
    I get exception 400 ( I think) whihc I assume is file cant be found.
    However when I rename the file (to get rid of that space) and also change the filename variable to suit. The file is opened as expected.
    What should I do to make the applet able to open paths with spaces? Or is this just not possible.
    I did try including quotes with the special characte precessor:
    filename = "/"http://192.168.0.2/agat/data/AF190701 0003.agt/""
    But this didnt work either, please could someone tell what I need.
    Thanks.

    Thanks guys, although before I got your replies I did the following - it seems to work, but shall try your suggestions.
    while (file.lastIndexOf(" ") >0)
    String temp;
    int num = file.lastIndexOf(" ");
    temp = file.substring(0, num) + "%20" + file.substring(num+1, file.length());
    file = temp;
    }

  • Open a form with space on the path with form builder from a batch

    Hi,
    I cannot open a form from a batch on Windows if the absolute path contains spaces.
    For example, if I try to open a form in "C:\" from cmd with C:\ORANT\bin\ifbld60.exe C:\Form.fmb, I have no problem, if I try to open a form in "C:\Documents and Settings" with C:\ORANT\bin\ifbld60.exe "C:\Documents and Settings\Form.fmb" or C:\ORANT\bin\ifbld60.exe C:\Documents and Settings\Form.fmb, I have some dialog with info and the error FRM-90927 and form builder doesn't start.
    Thank you,
    tom
    Edited by: 912104 on 16-ago-2012 3.17 - title

    Hi,
    >
    I cannot open a form from a batch on Windows if the absolute path contains spaces.
    For example, if I try to open a form in "C:\" from cmd with C:\ORANT\bin\ifbld60.exe C:\Form.fmb, I have no problem, if I try to open a form in "C:\Documents and Settings" with C:\ORANT\bin\ifbld60.exe "C:\Documents and Settings\Form.fmb" or C:\ORANT\bin\ifbld60.exe C:\Documents and Settings\Form.fmb, I have some dialog with info and the error FRM-90927 and form builder doesn't start.
    >
    Why is that you want to open a FMB in Form Builder with a Batch file?
    Is it that your application has only one FMB and that you work with only one FMB all the time?
    Cheers,
    PS: And if you must open the FMB through a batch file then look up the Form Builder Help for "Command Line options". It is an excellent resource.
    Edited by: Prabodh on Aug 16, 2012 3:06 PM

  • How should i set the baseURI when a db file path with a space

    if the db file in a path like c:\program file\myapplication,then i set the baseURI dbxml:c:\program file\myapplication ,some exception occur~what should i do ?
    thanks a lot

    The Base URI needs to be a valid URI, which means it cannot include the Windows '\' character at all. In your case, you should be fine using something along the lines of "file:////C:/program file/myapplication"
    (give or take a '/' or two -- I haven't tested this).
    It's a common for BDB XML users to confuse the argument to create/openContainer() (a filesystem path) with the Base URI (a URI). The meanings and requirements are different. The best thing to do is to set and use a container alias (XmlContainer::addAlias()) to use in your queries.
    Regards,
    George

  • (VS 2010 C++) cl.exe crashes when a lot of include paths are passed with /Zi, looking for workarounds

    Hello
    If i pass a lot of include paths to cl.exe that comes with Visual Studio 2010, and i also pass /Zi, cl.exe crashes (16.00.40219.01). Here's an attachment to reproduce the issue: http://www.filedropper.com/clexecrash
    Extract the folder to your system drive root (C:\), and paste the contents of command.txt into a cmd.exe instance. cl.exe will crash.
    test.cmd is a command file containing the line "/IREALLY_LONG_BOGUS_INCLUDE_PATH" 683 times, and /Zi. Please note, that if you either remove even one line of "/IREALLY_LONG_BOGUS_INCLUDE_PATH" or /Zi, the issue goes away. Without /Zi, there
    seems to be no limitation of include paths. Please also note, that it's not the sheer number of /I switches that causes this crash, if you replace REALLY_LONG_BOGUS_INCLUDE_PATH with something longer, you can crash cl.exe with less /I switches.
    This issue is also present in Visual Studio 2012 (17.00.61030), but seems to be fixed in 2015 CTP 5 (i don't have access to Visual Studio 2013, so i can't try). I know Visual Studio 2010 is not supported anymore, so does anyone know a workaround for this problem?
    Thanks in advance,
    Peter

    I cannot reproduce this issue with VS2013, your sample works well and generate a pdb file.
    It seems a issue in VS 2012, but sorry about that I have no workaround for this. Please check this thread: this issue only appear in debug mode.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/018ef85a-f172-4278-8215-30ad2a8accc2/clexe-crashes-using-large-number-of-include-directories?forum=vcgeneral
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • URI's with spaces

    Struggling with the new Mustang in-memory compilation stuff. Looks like Java is choking on URI's for paths that include spaces:
    import java.io.IOException;
    import java.util.Collections;
    import java.util.Locale;
    import javax.tools.Diagnostic;
    import javax.tools.DiagnosticListener;
    import javax.tools.JavaFileObject;
    import javax.tools.StandardLocation;
    import javax.tools.ToolProvider;
    public class Test {
      public static void main(String[] pArgs) throws IOException {
        for (
          JavaFileObject fileObj :
          ToolProvider.getSystemJavaCompilerTool().getStandardFileManager(
            new DiagnosticListener<JavaFileObject>() {
              public void report(Diagnostic<? extends JavaFileObject> pDiagnostic) {
                System.out.println(pDiagnostic.getMessage(Locale.getDefault()));
           ).list(
             StandardLocation.CLASS_PATH,
             Collections.<JavaFileObject.Kind>singleton(JavaFileObject.Kind.CLASS),
             true
          System.out.println(fileObj.toUri());
    <snip/>
    Exception in thread "main" java.lang.IllegalArgumentException
         at java.net.URI.create(URI.java:853)
         at com.sun.tools.javac.util.DefaultFileManager$ZipFileObject.toUri(DefaultFileManager.java:1338)
         at Test.main(Test.java:28)
    Caused by: java.net.URISyntaxException: Illegal character in path at index 15: jar:/C:/Program Files/Java/jdk1.6.0/lib/tools.jar!com/sun/jarsigner/ContentSignerParameters.class
         at java.net.URI$Parser.fail(URI.java:3061)
         at java.net.URI$Parser.checkChars(URI.java:3234)
         at java.net.URI$Parser.parsePath(URI.java:3338)
         at java.net.URI$Parser.parseHierpart(URI.java:3308)
         at java.net.URI$Parser.parse(URI.java:3267)
         at java.net.URI.<init>(URI.java:585)
         at java.net.URI.create(URI.java:851)
         ... 2 more
    This a bug or am I doing something stupid? In either case, is there a better way to get at the proper URI? I believe that I simply need to escape the spaces to '%20' somehow.

    please post the bug number here when you get it
    Apparently, this is a dup of bug 6219961.
    able to do this in 4 or 5 lines of code.Sorry, too lazy. And I submitted bug before reading your response.
    Date: Mon, 16 Oct 2006 12:40:58 -0600 (MDT)
    From: "Sun Microsystems" <[email protected]> Add to Address Book Add Mobile Alert
    Subject: Re: (Incident Review ID: 815209) DefaultFileManager.ZipFileObject.toUri() fails to escape space characters
    --- Note: you can send us updates about your Incident ---
    --- by replying to this mail. Place new information ---
    --- above these lines. Do not include attachments. ---
    --- Our system ignores attachments and anything below ---
    --- these lines. ---
    Hi Hollis Waite,
    This issue is related to Bug ID: 6219961. Thank you for providing additional information for
    our investigation.
    You can review this bug and look for related issues on the Java Bug Database at:
    http://bugs.sun.com/bugdatabase/index.jsp
    and
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6219961
    If you are a member of the Sun Developer Network (SDN), there are two options in addition to
    viewing the bug.
    1. Voting for the bug
    Click http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6219961.
    2. Adding the bug to your Bug Watch list.
    You will receive an email notification when this bug is updated.
    Click http://bugs.sun.com/bugdatabase/addBugWatch.do?bug_id=6219961.
    The Sun Developer Network (http://developers.sun.com) is a free service that Sun offers. To
    join, visit https://softwarereg.sun.com/registration/developer/en_US/new_user.
    For a limited time, SDN members can obtain fully licensed Java IDEs for web and enterprise
    development. More information is at http://developers.sun.com/prodtech/javatools/free/.
    Regards,
    Ingrid
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    NOTICE: This message, including any attachments, is for the intended
    recipient(s) only. If you are not the intended recipient(s), please
    reply to the sender, delete this message, and refrain from disclosing,
    copying, or distributing this message.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    --------------- Previous Messages ----------------
    2006-10-16 12:40:56.733 CHANGE REQUEST UPDATED
         Existing Change Request 6219961 updated by ty25508.
    --------------------- Report ---------------------
    category : java
    subcategory : classes_net
    release : mustang
    type : bug
    synopsis : DefaultFileManager.ZipFileObject.toUri() fails to escape space characters
    customer name : Hollis Waite
    customer mail : [email protected]
    sdn id : hwaite
    language : en
    company : NAVTEQ
    hardware : x86
    os : windows_vista
    bug id : 6219961
    date created : Sat Oct 14 10:13:50 MDT 2006
    date evaluated : Mon Oct 16 12:40:51 MDT 2006
    description :
    FULL PRODUCT VERSION :
    java version "1.6.0-beta2"
    Java(TM) SE Runtime Environment (build 1.6.0-beta2-b86)
    Java HotSpot(TM) Client VM (build 1.6.0-beta2-b86, mixed mode, sharing)
    ADDITIONAL OS VERSION INFORMATION :
    Microsoft Windows [Version 6.0.5744]
    A DESCRIPTION OF THE PROBLEM :
    com.sun.tools.javac.util.DefaultFileManager.ZipFileObject.toUri() throws an
    IllegalArgumentException if the path includes a space. This will occur frequently as the default Windows
    installation directory is "C:\Program Files\Java". See
    http://forum.java.sun.com/thread.jspa?messageID=4422238.
    STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
    1. Identify or create a path with one or more space characters.
    2. Add a JAR file to the directory.
    3. Modify classpath to include JAR.
    4. Use the standard file manager to obtain a JavaFileObject from JAR.
    5. Call toUri() on file object.
    EXPECTED VERSUS ACTUAL BEHAVIOR :
    EXPECTED -
    Method should return a valid URI.
    ACTUAL -
    Exception is thrown.
    ERROR MESSAGES/STACK TRACES THAT OCCUR :
    Exception in thread "main" java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:853)
    at
    com.sun.tools.javac.util.DefaultFileManager$ZipFileObject.toUri(DefaultFileManager.java:1338)
    at Test.main(Test.java:28)
    Caused by: java.net.URISyntaxException: Illegal character in path at index 15:
    jar:/C:/Program Files/Java/jdk1.6.0/lib/tools.jar!com/sun/jarsigner/ContentSignerParameters.class
    at java.net.URI$Parser.fail(URI.java:3061)
    at java.net.URI$Parser.checkChars(URI.java:3234)
    at java.net.URI$Parser.parsePath(URI.java:3338)
    at java.net.URI$Parser.parseHierpart(URI.java:3308)
    at java.net.URI$Parser.parse(URI.java:3267)
    at java.net.URI.<init>(URI.java:585)
    at java.net.URI.create(URI.java:851)
    ... 2 more
    REPRODUCIBILITY :
    This bug can be reproduced always.
    ---------- BEGIN SOURCE ----------
    import java.io.IOException;
    import java.util.Collections;
    import java.util.Locale;
    import javax.tools.Diagnostic;
    import javax.tools.DiagnosticListener;
    import javax.tools.JavaFileObject;
    import javax.tools.StandardLocation;
    import javax.tools.ToolProvider;
    public class Test {
    public static void main(String[] pArgs) throws IOException {
    for (
    JavaFileObject fileObj :
    ToolProvider.getSystemJavaCompilerTool().getStandardFileManager(
    new DiagnosticListener<JavaFileObject>() {
    public void report(Diagnostic<? extends JavaFileObject> pDiagnostic) {
    System.out.println(pDiagnostic.getMessage(Locale.getDefault()));
    ).list(
    StandardLocation.CLASS_PATH,
    Collections.<JavaFileObject.Kind>singleton(JavaFileObject.Kind.CLASS),
    true
    System.out.println(fileObj.toUri());
    ---------- END SOURCE ----------
    CUSTOMER SUBMITTED WORKAROUND :
    Decompile tools.jar and examine toUri() method of FileObject implementation. Replace spaces
    with "%20" prior to the URI.create call:
    if (mFileObject instanceof DefaultFileManager.ZipFileObject) {
    final DefaultFileManager.ZipFileObject fileObj = (DefaultFileManager.ZipFileObject)
    mFileObject;
    String s = (new File(fileObj.getZipName())).toURI().getPath().replaceAll(" ", "%20");
    String s1 = fileObj.getZipEntryName();
    return URI.create((new
    StringBuilder()).append("jar:").append(s).append("!").append(s1).toString());
    }

  • Bug in the copy cluster roles wizard - CSV reparse points cannot have names with spaces

    Hi All,
    I have identified a bug in the copy cluster roles wizard in 2012 R2, which is preventing me from migrating my clusters from 2008 R2 & 2012 to 2012 R2.
    The bug surfaces when you attempt to copy a VM role from a 2008 R2 or 2012 cluster that has a CSV reparse point name that contains spaces as follows:
    The role appears to copy across fine, but once you've migrated the CSV and brought it online followed by starting the VM, the VM configuration resource promptly fails along with the VM.
    The issue can be spotted inside the copy cluster roles wizard, where it presents itself by removing all text after the first space in the name to read "C:\ClusterStorage\CSV" rather than "C:\ClusterStorage\CSV
    Test Disk 3" as follows:
    The bug only appears for VMs on CSVs with a reparse point name containing spaces - all other scenarios succeed.
    After searching through the registry on the new cluster, you can clearly see that the VM role hasn't been correctly copied.
    It shows a value called SharedVolumeMappings with the data C:\ClusterStorage\CSV|<guid>|<integer>
    Whereas it should show the data C:\ClusterStorage\CSV Test Disk 3|<guid>|<integer>
    If you modify the data in the SharedVolumeMappings value in both
    0.Cluster\Resources\<VM guid> and Cluster\Resources\<VM guid> keys, the VM will start and work correctly.
    The problem for me is that I have many VMs on many different CSVs all with spaces in the names of the reparse point! Its not feasible for me to go through the registry for every copied VM on every node of the new cluster, as this would take a very long time
    and would be prone to errors that could cause further problems.
    Can anyone provide any help on this? A hotfix for the issue would be great, if anyone from Microsoft is reading :-)
    My deadline to get the VMs migrated to the new cluster is the 21st February, so I would really like to have a solution to the problem before then if at all possible.
    Many thanks in advance,
    Tom

    Hi Subhasish,
    Thanks for the reply, glad that its something that is reproducible!
    Do you have any idea of timescale? Or is it likely that I will have to modify the registry as above to get this working?
    If I am going to have to modify the registry, please can you let me know if the resolution I have tested above is safe and viable? Or are there other settings that I will need to change to make the cluster fully aware of the proper path to the CSVs for its
    VMs?
    Also, is there a known procedure for renaming the reparse point whilst VMs are running on it? This would allow me to negate the issue before copying the roles to the new cluster :-)
    Thanks again,
    Tom

  • Problems with spaces in file or directory names and Word.exe

    Hi
    I'm trying to open a file with Word from my java aplication, and I have a problem with some file/directory names.
    I have this
    String cmd = "c:\\Program Files\\Microsoft Office\\Office10\\WINWORD.EXE" + " " + path;
    try {
    Runtime.getRuntime().exec(cmd);
    } catch (Exception errorea){ }
    Here is what happens:
    if path is something like this: "c:\people\info.doc" , there's no problem, Word opens the document, but if path contains blank spaces somewhere, it doesn't work. For example:
    path = "c:\Documents and Settings\info.doc"
    path = "c:\Hi everybody\info.doc"
    path = "c:\tests\test results.doc"
    with the above examples it doesn't work :( Word tries to open "c:\Documents", "c:\Hi" or "c:\tests\test".
    Can anyone help? thanx a lot ! : )

    Hint: use the variant Runtime.exec(String[] args).
    Create a command array, with each token in a separate argument. The entire filename with spaces goes into one argument.

  • Apex Listener/Apache Tomact and filenames with spaces

    I've installed the Apex Listener with Apache Tomcat, and all seems to work fine. Except when I try to do a CSV file data upload via the utilities screen in apex. If the filename/directory path contains spaces, then Apex reports "File Must Be Specified" error - yet if I do this same operation via EPG instead of Tomcat, it works. Are there any restrictions in Tomcat to using spaces??

    Look at this thread. Re: File upload problem
    regards.

  • [SOLVED] problem with spaces and ls command in bash script

    I am going mad with a bash script I am trying to finish. The ls command is driving me mad with spaces in path names. This is the portion of my script that is giving me trouble:
    HOMEDIR="/home/panos/Web Site"
    for file in $(find "$HOMEDIR" -type f)
    do
    if [ "$(dateDiff -d $(ls -lh "$file" | awk '{ print $6 }') "$(date +%F)")" -gt 30 ];
    then echo -e "File $file is $(dateDiff -d $(ls -lh "$file" | awk '{ print $6 }') "$(date +%F)") old\r" >> /home/panos/scripts/temp;
    fi
    done
    The dateDiff() function is defined earlier and the script works fine when I change the HOMEDIR variable to a path where there are no spaces in directory and file names. I have isolated the problem to the ls command, so a simpler code sample that also doesn't work correctly with path names with spaces is this:
    #!/bin/bash
    HOMEDIR="/home/panos/test dir"
    for file in $(find "$HOMEDIR" -type f)
    do
    ls -lh "$file"
    done
    TIA
    Last edited by panosk (2009-11-08 21:55:31)

    oops, brain fart. *flushes with embarrassment*
    -- Edit --
    BTW, for this kind of thing, I usually do something like:
    find "$HOMEDIR" -type f | while read file ; do something with "$file" ; done
    Or put those in an array:
    IFS=$'\n' ; files=($(find "$HOMEDIR" -type f)) ; unset IFS
    for file in "${files[@]}" ; do something with "$file" ; done
    The later method is useful when elements of "${files[@]}" will be used multiple times across the script.
    Last edited by lolilolicon (2009-11-09 08:13:07)

Maybe you are looking for

  • Why doesn't my Macbook Pro disk drive work?

    I used to have an old white MacBook and that disk drive didn't work as well as some other problems... the people in the Apple Store couldn't fix it and so gave me a free upgrade to a MacBook pro (great, right?!). Everything on it works perfectly exce

  • Is there a completely reliable method of adding months to a date in ABAP?

    Does anyone know of a completely reliable and consistent ABAP function module that can be used to add months to a date.  One that will always get the correct last day of the month when requested to add 1 month to the last day of the previous month. 

  • Connecting Ipad to a Monitor?

    Are you able to connect Ipad to a LED monitor with a DVI plug?  We have an Apple digital AV adapter which does not provide the correct fitting for a DVI.  And a DVI adapter which does not fit the Ipad2.  Any ideas?

  • Photoshop CC stops working whenever I save

    I'm pretty sure this only started happening after the most recent update to CC. My event log looks like this: Faulting application name: Photoshop.exe, version: 14.2.1.570, time stamp: 0x52f4a9f2 Faulting module name: MediaCoreIF.DLL, version: 7.0.0.

  • TooManyObjectsException

    hi, I'm using ADF 11.1.1.2. on a jsp page, I have a table with two fields as its primary key ('date' and 'ser'). there are 2 records with these primary keys (1391/11,1) and (1391/11,2). the table is rendered with no problem but when I'm moving betwee