tags:

views:

46

answers:

1

Hey, I had a problem with the limitation of paths Here for example I run this command... :

String[] cmd = new String[] {"command.com","/C", "Resource\\gcc.exe", "-E",
in_path, ">",
"out_path"};

in_path : the path where is contain the directory of file cpp
out_path: output file after processing the first bearing the same name as input and thus fichier.cpp

for exemple: in_path= d:/directorycpp/file1.cpp out_path= file1.cpp

Well there are two cases that don't function in tests If the path is set when the cpp file for the test is too long If the path is short and that the file name contains more than 8caractère then it goes not so. I read that gcc has limited character, but when I run my command in command prompt it passes So why does not work in my case Should I add an option or another??

+2  A: 

Change "Resource\gcc.exe" to "Resource\\gcc.exe".

Paul R
I work in XP windows, and you can not do like thisthe problem is in the limitation of paths cause with the short path it work very well
bilinemiline
Regardless of any perceived problem with path lengths, you still need to fix the escaping of backslash characters in C/C++ string literals.
Paul R
OK sorry I haven't give you the right syntaxethis is what I have doString[] Commande = new String[] {"command.com","/C", "Resource\\gcc.exe", "-E", "-B","Resource", in_path, ">", "test\\"+out_path};Here where the path is short the program work very welAnd I do this before the commande in_path =in_path.replace("\\", "/");I work in JAVA
bilinemiline
OK - I have now slightly edited and re-tagged your post to reflect what you're actually trying to do. It sounds like a Windows issue but I don't know anything about Windows, sorry.
Paul R
but I think thant is not in the system but in the command???
bilinemiline