Problem opening files or directories with a percent sign in the name
#16
Thanks. So directories with % in them list OK, and I'm guessing that files with % list OK as well, but they do nothing when you click on 'em? Is there anything logged to the Debug Log when this happens?

Is the AFP share also on a mac?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#17
(2013-11-17, 06:47)jmarshall Wrote: Thanks. So directories with % in them list OK, and I'm guessing that files with % list OK as well, but they do nothing when you click on 'em? Is there anything logged to the debug log when this happens?

Is the AFP share also on a mac?

The AFP share is on a mac of course. Correct, the directories/files with the '%' sign list just fine but they will not display contents/play when clicked.

Image

As for my debug log, I did find the problem:

Code:
13:20:42 T:2685891904  NOTICE: DVDPlayer: Opening: afp://192.168.1.100/Movies/AVS HD 709 - Blu-ray Calibration/MP4-2c/CalMAN Fields/5 Step Grayscale/1-100% White.mp4
.
.
.
13:20:42 T:2957688832  NOTICE: Creating InputStream
13:20:42 T:2957688832   DEBUG: AFP: Using anonymous authentication.
13:20:42 T:2957688832    INFO: CAFPFile::Open: Unable to open file : '/AVS HD 709 - Blu-ray Calibration/MP4-2c/CalMAN Fields/5 Step Grayscale/1-100White.mp4'
                                            unix_err:'2' error : 'No such file or directory'
13:20:42 T:2957688832   DEBUG: CAFPFile::Close closing fd 0
13:20:42 T:2957688832   ERROR: CDVDPlayer::OpenInputStream - error opening [afp://192.168.1.100/Movies/AVS HD 709 - Blu-ray Calibration/MP4-2c/CalMAN Fields/5 Step Grayscale/1-100% White.mp4]

So it is your typical unix naming convention incompatibility. It interpreted "% " as some escape character or format string(?) and ate it up.

I can open the file, no problem, in VLC from the command line, both on the local mac where the file resides and on the remote mac over the AFP share, if the filename is quoted:

Code:
Mac-Pro-2010:5 Step Grayscale user$ /Applications/VLC.app/Contents/MacOS/VLC "1-100% White.mp4"
Code:
MBP:5 Step Grayscale user$ /Applications/VLC.app/Contents/MacOS/VLC "1-100% White.mp4"


So it looks like the main XBMC app is not properly quoting the filename string. Is this problem limited to unix-based OSs?
Reply
#18
Looks like there's a URL encode/decode going on there. I'll see if it's in an obvious spot.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#19
(2013-11-18, 00:53)jmarshall Wrote: Looks like there's a URL encode/decode going on there. I'll see if it's in an obvious spot.

OK. Thanks.
Reply
#20
(2013-11-18, 00:31)XBMCMBX Wrote: Is this problem limited to unix-based OSs?

It looks like it is. I installed XBMC on a Windows XP VM and it had no problem opening these files. Huh
Reply
#21
Using the AFP protocol in the same way? It's likely the protocol, not the host machine that is the cause.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#22
OK, found the bugger. As you suspected, it's a sprintf() where it should be a strcpy() inside afpfs-ng. I've added a patch to the dependency and have pushed a PR here:

https://github.com/xbmc/xbmc/pull/3672

I'll get jenkins to do up a build for you to test (I fixed it in the blind).

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#23
(2013-11-18, 03:51)jmarshall Wrote: Using the AFP protocol in the same way? It's likely the protocol, not the host machine that is the cause.

Using whatever protocol VMWare uses for a shared drive on the host machine. I tried copying the '5 Step Grayscale' folder directly to the system drive of the MBP that is running XBMC and the files did open no problem. But that is not over a network so the path resolution is done differently:

Code:
20:13:23 T:2685891904  NOTICE: DVDPlayer: Opening: /Users/user/Movies/5 Step Grayscale/1-100% White.mp4

as opposed to:

Code:
13:20:42 T:2685891904  NOTICE: DVDPlayer: Opening: afp://192.168.1.100/Movies/AVS HD 709 - Blu-ray Calibration/MP4-2c/CalMAN Fields/5 Step Grayscale/1-100% White.mp4

which results in:

Code:
13:20:42 T:2957688832    INFO: CAFPFile::Open: Unable to open file : '/AVS HD 709 - Blu-ray Calibration/MP4-2c/CalMAN Fields/5 Step Grayscale/1-100White.mp4'
                                            unix_err:'2' error : 'No such file or directory'

It seems AFP is performing as it should, the path is being read correctly when attempting to open it but "% " is being converted to "" when attempting to read it, resulting in 'file not found' error.

I get similar results with VLC if I don't enclose the path in quotes:

Code:
Mac-Pro-2010:5 Step Grayscale user$ /Applications/VLC.app/Contents/MacOS/VLC 1-100% White.mp4
VLC media player 2.1.0 Rincewind (revision 2.1.0-0-gedd8835)
[0x100207570] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0x10a90a320] filesystem access error: cannot open file /Users/user/Movies/AVS HD 709 - Blu-ray Calibration/MP4-2c/CalMAN Fields/5 Step Grayscale/1-100% (No such file or directory)
[0x103a59ed0] main input error: open of `file:///Users/user/Movies/AVS%20HD%20709%20-%20Blu-ray%20Calibration/MP4-2c/CalMAN%20Fields/5%20Step%20Grayscale/1-100%25' failed
[0x103e11f50] filesystem access error: cannot open file /Users/user/Movies/AVS HD 709 - Blu-ray Calibration/MP4-2c/CalMAN Fields/5 Step Grayscale/White.mp4 (No such file or directory)
[0x108400c90] main input error: open of `file:///Users/user/Movies/AVS%20HD%20709%20-%20Blu-ray%20Calibration/MP4-2c/CalMAN%20Fields/5%20Step%20Grayscale/White.mp4' failed

The path must be quoted to work. I can play any media file that does not have that character in the name over AFP. It is how XBMC resolves the path over a network that is likely the problem, and not the protocol. It is converting that character pair and changing the filename when it passes it to the play routine.
Reply
#24
Yup - see above. afpfs-ng (the library used for AFP access) has a bug in it, not XBMC. Anything else using afpfs-ng will fail in the same way (e.g. accessing the share on a linux system over AFP will likely fail in the same way if afpfs-ng is used).

I'll post here when the build is ready for testing - unless ofc you can build yourself - feel free in that case to checkout the PR and build.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#25
(2013-11-18, 04:55)jmarshall Wrote: OK, found the bugger. As you suspected, it's a sprintf() where it should be a strcpy() inside afpfs-ng. I've added a patch to the dependency and have pushed a PR here:

https://github.com/xbmc/xbmc/pull/3672

I'll get jenkins to do up a build for you to test (I fixed it in the blind).

Cheers,
Jonathan

OK. Who knows what sprintf would do in a case like that? "% " is like a format flag in the middle of a string. Apparently it ignores it.

Thanks so much for all the work. Great job! Please post patch/update when it is ready. I'll test it out.
Reply
#26
Here's an OSX-64 build that should fix it: http://mirrors.xbmc.org/test-builds/osx/...x86_64.dmg

Or a 32bit build: http://mirrors.xbmc.org/test-builds/osx/...--i386.dmg

Please test and let me know if there's any other oddities introduced.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#27
(2013-11-18, 22:19)jmarshall Wrote: Here's an OSX-64 build that should fix it: http://mirrors.xbmc.org/test-builds/osx/...x86_64.dmg

Or a 32bit build: http://mirrors.xbmc.org/test-builds/osx/...--i386.dmg

Please test and let me know if there's any other oddities introduced.

OK, I backed up the old app and the application folder and installed the 64-bit test app. I got nothing but incompatibility errors when I attempted to open the network share:

Image
Image
Image

and many more. Sad
Reply
#28
Absolutely nothing to do with this at all. Reason you have unmet dependencies is because this is a Gotham build, and one presumes you have lots of add-ons from Frodo.

Just say "No" to all of them until they're gone.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#29
(2013-11-20, 00:14)jmarshall Wrote: Absolutely nothing to do with this at all. Reason you have unmet dependencies is because this is a Gotham build, and one presumes you have lots of add-ons from Frodo.

Just say "No" to all of them until they're gone.

I do have SOME add-ons and I did just click NO to all the errors but I couldn't open the folder.
Reply
#30
Can you please get me a Debug Log of you trying to open the folder?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Problem opening files or directories with a percent sign in the name0