![]() |
|
|||||||
| Plugin/Script (Python) Development Developers forum for XBMC Python Plugins/Scripts. Scripters/coders only! Not for posting feature requests, bugs, or end-user support requests! |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 | |
|
Senior Member
Join Date: Mar 2004
Posts: 174
![]() |
i am currently working on getting mythtv preview screenshots displaying in xbmc for the xbmc mythtv project. i have a .png file that i am copying from a smb share. when i test the code to copy a .png on a linux machine, the .png is copied correctly byte for byte. however, when i copy the .png using the interpreter in xbmc, the .png ends up being corrupted.
at first i suspected that the smb module that i am using was messed up so i put some print statements in to see how many bytes were written to the file by counting up the values returned by write(). it all added up to 34875 which is the correct size of the file. however, when i view the file on the xbox filesystem over an ftp connection, the size is 34993 and if i transfer it in binary mode back to linux and try to view it, gimp reports "png file corrupted by ascii conversion". so i thought i should write a program to demonstrate this bug. unfortunately, the following code hangs in xbmc after writing 6 bytes. the same code running in linux makes an exact copy of the file. Quote:
|
|
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Apr 2004
Posts: 8
![]() |
assuming the file that you sent back to linux is 34993 bytes, have you tried to do a byte comparison and see where the changes are occuring or what is being added?
edit: does read assume a string. if so it may be trying to escape some of the "ascii" characters? just an idea |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2004
Posts: 174
![]() |
ok, i managed to figure out a way to get it work. using the python built-in file object, you can open a file for writing in binary mode and it gets written correctly.
i guess it was late last night when i tried using os.write() because i should've thought to check for file objects in python. although it is a bit odd given that os.write() is supposedly a lower level interface... |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Does anyone can write a python to view web? | hibaby | Plugin/Script (Python) Help and Support | 1 | 2005-07-27 19:29 |
| Possible to write a server via the python api? | tharvey | Plugin/Script (Python) Development | 7 | 2005-02-08 07:21 |
| Cddb / imd write .tbn file? | sarnman | XBMC Feature Suggestions | 2 | 2004-12-20 00:51 |
| Does XBMC write to the Xbox's EEPROM? | tullm | XBMC General Discussion | 3 | 2004-10-12 19:47 |
| Please help me write this script: | EminaZ | Plugin/Script (Python) Development | 3 | 2004-04-08 10:18 |