Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#111 closed defect (invalid)

%2F in filename causes error

Reported by: EdT Owned by: s10k
Priority: major Component: Vago
Keywords: Cc:

Description (last modified by Iritscen)

-create "/Users/EKT2014/Games/Oni/AE/Tools/VagoGUI/VagoWorkspace/XML/XML - ONI/" "/Users/EKT2014/Desktop/TXMPIteration001%2FKS_chestpack.xml"
System.IO.DirectoryNotFoundException: Could not find a part of the path "/Users/EKT2014/Desktop/TXMPIteration001/KS_chestpack.xml".

It has been such a long time having to deal with %2F in a filename I forgot the solution :(

Edit: You mean "%2F" --Iritscen

Change History (7)

comment:1 by s10k, 9 years ago

Edt that error is from OniSplit not Vago.

Do you know any way to pass it to OniSplit without causing that error?

Last edited 9 years ago by s10k (previous) (diff)

comment:2 by Iritscen, 9 years ago

If I may butt in here, I tried sending a file with "%2F" in it to OniSplit on the command line, and it worked fine, so it seems that there's an issue in the way that Vago is encoding and passing the command string to OniSplit. Something in Qt, perhaps, is interpreting the %2F as the ASCII hex code for "/" (which, of course, it is), rather than passing it as-is.

comment:3 by Iritscen, 9 years ago

Description: modified (diff)
Summary: %2 in filename causes error%2F in filename causes error

comment:4 by EdT, 9 years ago

s10k

I use this code:

on convert_path_to_UNIX(raw_path_name)

set safe_path_name to ""
set found_colon to false
set first_colon to 1
set escape_list to {" ", "'", "(", ")","%2F"} -- add any other char.s that need escaping here
set colon to ":" -- gets changed to forward-slash if present
set num_escapes to count of escape_list
set num_char to count of characters in raw_path_name
set found_colon to false
repeat with x from first_colon to num_char -- start after hard drive's name

if (character x in raw_path_name is colon) then

set safe_path_name to safe_path_name & "/"
set found_colon to true

else

repeat with y from 1 to num_escapes

if (character x in raw_path_name is (item y of escape_list)) then

set safe_path_name to safe_path_name & "
"

end if

end repeat

end if
if (found_colon is false) then

set safe_path_name to safe_path_name & character x in raw_path_name

else

set found_colon to false

end if

end repeat
return safe_path_name

end convert_path_to_UNIX

Iritscen: Did you write this code for me?

Version 0, edited 9 years ago by EdT (next)

comment:5 by Iritscen, 9 years ago

The code you posted is not going to be useful to s10k since it's in AppleScript :-) He just needs to figure out how to get Qt to not interpret tokens like %2F when sending a command to the command line.

comment:6 by EdT, 9 years ago

Interesting, this command works:

mono onisplit.exe -create:txmp /Users/EKT2014/Desktop -genmipmaps -format:bgra32 -envmap:TXMPenvksface /Users/EKT2014/Desktop/TXMPIteration001%2FKS_face.tga

but this gets the error message:

mono onisplit.exe -create /Users/EKT2014/Desktop /Users/EKT2014/Desktop/TXMPIteration001%2FKS_face.xml

Edit: Trying to escape the %2F with this: TXMPIteration001\%2FKS_face.xml did not work either. I sent a message to Neo by Yahoo Messenger, hopefully he can fix this.

Last edited 9 years ago by EdT (previous) (diff)

comment:7 by s10k, 9 years ago

Resolution: invalid
Status: newclosed

@Iritscen this is definitely a OniSplit problem, not a Vago one.

For example this command:

mono OniSplit.exe -create "/Users/ricardosantos/qt-workspace/VagoGUI/trunk/build-Vago-Desktop_Qt_5_6_0_clang_64bit-Debug/VagoWorkspace/XML/XML - ONI/" "/Users/ricardosantos/qt-workspace/VagoGUI/trunk/build-Vago-Desktop_Qt_5_6_0_clang_64bit-Debug/VagoWorkspace/XML/ONI - XML/BINACJBOCombat%2F.xml"

Gives the same error when executed from the MacOS X terminal as in Vago:

WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319
Importing /Users/ricardosantos/qt-workspace/VagoGUI/trunk/build-Vago-Desktop_Qt_5_6_0_clang_64bit-Debug/VagoWorkspace/XML/ONI - XML/BINACJBOCombat%2F.xml
System.IO.DirectoryNotFoundException: Could not find a part of the path "/Users/ricardosantos/qt-workspace/VagoGUI/trunk/build-Vago-Desktop_Qt_5_6_0_clang_64bit-Debug/VagoWorkspace/XML/ONI - XML/BINACJBOCombat/.xml".

Last edited 9 years ago by s10k (previous) (diff)
Note: See TracTickets for help on using tickets.