Pb converting plist to binary format

Hi,
I have an XML plist generated by a perl program that I would like to convert to binary plist in a shell script. So I'm using the dedicated "plutil" program from the command line.
Alas it won't convert the plist to binary, leaving it in XML format wether I try :
plutil - convert binary1 fuel.plistorplutil -convert binary1 -o fuel2.plist fuel.plist
So I try this :plutil -convert binary1 -o - fuel.plistto send the result to the STDOUT.
Bingo, the output is definitely a binary plist as it starts with the "bplist" signature and is followed by lots of non human-readable characters.
But ... when I tried this :plutil -convert binary1 -o - fuel.plist > fuel2.plistIstill get that XML file !!
I tried with different filenames like fuel.db for the output in case plutil would reserve the .plist extension to XML format. I also validated the input file with plutil.
This is driving me crazy ... There must be something, but what ?
Any help appreciated
Regards
Phil

Rather than 'cat' I would definitely suggest 'hexdump' as 'cat'ing a binay file to a terminal might lead to somewhat weird results. Try one of these:
%> hexdump -C fuel2.plist
%> hexdump -C fuel2.plist | less
%> hexdump -C fuel2.plist | head
Another possibility would be to test the type of the file using the 'file' utility:
%> file fuel.plist
fuel.plist: XML document text
%> file fuel2.plist
fuel2.plist: Apple binary property list
I think that's rather clear
HTH

Similar Messages

  • How to convert image to binary format

    Hi all,
      We have developed an Employee search  mobile web application in .net which is hosted on an exposed IP server, we need to show the employee data along with the image of the employee on mobile.
    When we run this application through our desktop we are able to see the image of the employee since we are doing this through <b>intranet</b> , but when we try to access the same from any mobile device we are able to see only the data but no image, since we are doing this through <b>internet(exposed server).</b>
    Please suggest some way to get this image,
    is there any<b> function module in ABAP</b> which can <b>convert image to binary format</b>
    so that we <b>export binary data</b> to .net application

    Hei evryone!
    CAn anyone pls help me on how to solve this error:
    java.security.AccessControlException: access denied (java.security.SecurityPermission insertProvider.SunJCE)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkSecurityAccess(Unknown Source)
         at sun.plugin.security.ActivatorSecurityManager.checkSecurityAccess(Unknown Source)
         at java.security.Security.check(Unknown Source)
         at java.security.Security.insertProviderAt(Unknown Source)
         at java.security.Security.addProvider(Unknown Source)
         at CryptoTest.processFile(SwingApplet.java:68)
         at CryptoTest.<init>(SwingApplet.java:65)
         at SwingApplet.init(SwingApplet.java:39)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Is it allright for a swing code to access local resources? like in my case i want my swing app to decrypt and encrypt an image file but when i tried to access the method for decrypting and encrypting i got this error message on my console. Do i have to make my code signed before i could write/read a file on my hard drive?
    Any help / suggestions would be much appreciated.Thanks!

  • Converting bytearray into binary format

    Hi I have a byteaary , I want to convert this byteArray data into binary format (01010101) , Please help me
    [Bindable]
                private var imgByte:ByteArray;
    bitmapData     = new BitmapData(pic.width, pic.height);
                     bitmapData.draw(pic,new Matrix());
                    var jpg:JPEGEncoder = new JPEGEncoder();
                    imgByte = jpg.encode(bitmapData) ;
    var i:int=imgByte.readByte()
    Alert.show(i.toString(2));
    thanks in advance

    Didn't toString(2) work?

  • Fm or method for converting  doc,pdf or text  files to binary format

    Hello,
    Are you aware of any function module or method which takes input as a file of type doc, pdf or text files and convert it to binary format? Kindly let me know.
    This is what i tried and was unsuccessful.
    i tried using gui_upload method and pass " asc" as file type while importing file of type .doc but it returns me string filled with strange characters.
    I did try converting this string to xstring using  cl_proxy_service=>cstring2xstring but i realized my 1st step of uploading file itself was wrong.
    Please let me know what can be done if you are aware of how to convert file of various types to binary.
    thanks
    Pooja

    hi All,
    thanks alot for the information and help provided by all of you.
    I did figure out a way where the word document or pdf  can be pretty much loaded with gui_upload. the file type used in the method would be "BIN" the following thing has to be done. declare data type as given below and file would be the complete path along with document name which has to be uploaded
    DATA: BEGIN OF res_line,
                raw(255) TYPE x,
             END   OF res_line.
      DATA: res_tab LIKE res_line OCCURS 0 WITH HEADER LINE.
    data :  wf_var_stringx TYPE xstring .
      CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename                =  file
            filetype                = 'BIN'
            read_by_line            = 'X'
         has_field_separator     = ' '
         header_length           = 0
         header_line           = 'X'
          IMPORTING
            filelength              = l_filelength
          TABLES
            data_tab                = res_tab
          EXCEPTIONS
           OTHERS                  = 1.
    LOOP AT res_tab .
        CONCATENATE wf_var_stringx res_tab-raw INTO wf_var_stringx IN BYTE MODE.
      ENDLOOP.
    this will upload the file and will file the string x with its content.
    hope this helps to some of you.
    Thanks
    Pooja

  • Convert Excel to Binary

    Dear All,
    Has anyone experience convert excel to binary ?
    For example, I have an excel file in my PC then I would like to set it as attachment in mail using CL_DOCUMENT_BCS. Attachment in this class only have two version, as text or as hexadecimal.
    In order to create hexadecimal content I need a binary format, i will use function SCMS_BINARY_TO_XSTRING.
    The problem is, how to convert excel to binary format.
    Thanks in advance.
    Rgds,
    Deny

    code snippet .
    data: xml_tab1 type solix_tab .
    call function 'GUI_UPLOAD'
        exporting
          filename            = filename
          filetype            = 'BIN'
          has_field_separator = ' '
          header_length       = 0
        importing
          filelength          = size
        tables
          data_tab            = xml_tab1
        exceptions
          others              = 1.
    call method document->add_attachment
                exporting
                  i_attachment_type    = 'XLS'
                  i_attachment_subject = atta_sub
                  i_att_content_hex    = xml_tab1.

  • How can I add three binary numbers and then convert to string (Hex format)?

    Hi All,
    I have my problem "half" resolved, but need some assistance on the final piece.  Overall, I need to take three string values (hex format), convert them to binary, add them and then convert back to a string (hex format).  If that doesn't make sense maybe this will:
    Final Result (My target) = 0xCC
     = 0x03 + 0x01 + 0x04
              = 0x03; 0011b
              = 0x01; 0001b
              = 0x04; 0100b
    For my app, we are dropping "masking" some of the bits so that we get 1 byte:
              = 0x03; 11b
              = 0x01; 001b
              = 0x04; 100b
    So...
    11001100b = 0xCC
    In my VI, I am taking each initial string [0x03,0x01 and 0x04] type casting them to U8.  Next I need to "mask" the binary values as shown above and then add them.  I am not sure how to do this in LV??
    Thanks for the help,
    Bryan

    Hi Bryan,
    there's a conversion palette in the string palette, ever looked at those functions?
    The rest is pure simple math:
    It's the straight-forward way, there are other possibilities too!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Converting Resource(Dictionary Simple Type) to Binary Format.

    Hello Experts,
    In my Web Dynpro Application,
    I have a View Context attribute called "FileResource" of type Resource(Dictionary Simple Type) which is bound to the FileUpload UIElement of View.
    When im running the application I am able to Upload the file in my view context attribute successfully,
    Now I need to pass it to the RFC as an Import Parameter which is declared as type "RAW-Uninterpreted Sequence of bytes",
    kindly guide me how to convert the value of the view context attribute "FileResource" of type Resource(Dictionary Simple Type) into BINARY format, so that i can pass it to the RFC as an import parameter.
    Thank you please reply.........

    I used this code from a tutorial.  And it work.  Place Some of this code on any button.
         IPrivateFileUploadVIEW.IContextElement element = wdContext.currentContextElement();
         //if a file in the FileUpload field exists
         if (element.getResource() != null)
              IWDResource resource = element.getResource();
              try{
                   InputStream archivo = resource.read(false);
                   byte[] b = new byte[5000];
                   archivo.read(b);
                   //ResourceBundle.getBundle();
                   wdContext.currentZ_Lmmfu_Cambio_Estado_InputElement().setI_Archivo(b);
                   wdThis.wdGetAdminCMPController().executeZ_Lmmfu_Cambio_Estado_Input();
                   //Imprimir nombre del archivo     
                   String name=resource.getResourceName();
                   wdComponentAPI.getMessageManager().reportException(name,false);
                        File f = new File(resource.toString());
         catch(IOException error)
              wdComponentAPI.getMessageManager().reportException(error.toString(),false);
          //report success message
         // wdComponentAPI.getMessageManager().reportMessage(IMessageAdministracionCMP aa ,new Object[] { resource.getResourceName()}, false);
          else
         // if no file in the FileUpload field exists
         //     report error message
         wdComponentAPI.getMessageManager().reportException("Search for a file",false);
         //     clear the 'FileResource' context value attribute
         element.setResource(null);
    Is there a better way to do this.
    I need to get the creation or modification date from the original file.  How can I do this?

  • Create a Document in DMS and attach a file coming in binary format

    Hi to all,
    I have to create a new document in DMS (trx: CV01N) with an attachment but this attachment is a pdf file in binary format. Can I use bapi "BAPI_DOCUMENT_CREATE2"? It support binary files in input or I have to convert files in someway? Or I have to use another BAPI?
    I'm using an r/3 4.6c and I know that it is a big limit.
    Please, I need help.
    Thank you very much in advance,
    Enrico

    That assumes two things:
    1. That Apple would have let Microsoft have access to its file format.
    2. That Microsoft would want to spend the time and trouble to write filters for file formats that Apple can't be bothered doing for its own software.
    Peter

  • Replace the XML Tags which are in binary format in 4.6C Version

    Hi Experts,
    I have an issue. I am working on 4.6 c version of sap. I have a requirement to send  ftp of an xml file. I created an internal table which has components of table type too ( For Line items ). After appending a record of sales order into the table I am using   SDIXML_DATA_TO_DOM ( To attach the to the document ) and SDIXML_DOM_TO_XML ( To convert the document contents into XML ( Binary Format ).
           CLASS cl_ixml DEFINITION LOAD.
          g_ixml = cl_ixml=>create( ).
          CHECK NOT g_ixml IS INITIAL.
          m_document = g_ixml->create_document( ).
          CHECK NOT m_document IS INITIAL.
          CALL FUNCTION 'SDIXML_DATA_TO_DOM'
            EXPORTING
              NAME               = 'xmldata'   " data in character format
              DATAOBJECT         = xmldata[]
           IMPORTING
             DATA_AS_DOM        = l_dom
           CHANGING
             DOCUMENT           = m_document
           EXCEPTIONS
             ILLEGAL_NAME       = 1
             OTHERS             = 2
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CHECK NOT l_dom IS INITIAL.
          w_rc = m_document->append_child( new_child = l_dom ).
          IF w_rc IS INITIAL.
          WRITE 'OK'.
          ELSE.
          WRITE: 'ERR ='.
          ENDIF.
          CALL FUNCTION 'SDIXML_DOM_TO_XML'
            EXPORTING
              DOCUMENT            = m_document
            PRETTY_PRINT        = ' '
            IMPORTING
              XML_AS_STRING       = w_string
              SIZE                = w_size
            TABLES
              XML_AS_TABLE        = it_xml   " Final XML data ( with xml tags ( xml tags are the field names of internal table ) ) in bin
            EXCEPTIONS
              NO_DOCUMENT         = 1
              OTHERS              = 2
          IF SY-SUBRC = 0.
          WRITE 'OK'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ELSE.
          WRITE: 'ERR =',
          sy-subrc.
          ENDIF.
    So, it_xml has the binary format of XML data.
    Now the requirement is that I need to get rid of some XML tags in the final internal table XML data. Because by default, at the start of the the table row the <item> and </item> tags are inserted. This is automatically done in the Function module
    SDIXML_DOM_TO_XML.
    I want to find out the binary string of <item> and </item> and replace them by null binary string. I know how to replace the character strings but not for binary strings in 4.6 C.
    It is little bit urget. I would appreciate the quicker answer.

    Hi,
    check this program , I think this will help you
    TYPE-POOLS: ixml.
    TYPES: BEGIN OF xml_line,
    data(256) TYPE x,
    END OF xml_line.
    data : itab like catsdb occurs 100 with header line.
    data : file_location type STRING.
    data : file_name like sy-datum.
    data : file_create type STRING.
    file_name = sy-datum .
    file_location = 'C:\xml\'.
    concatenate file_location file_name into file_create.
    concatenate file_create '.XML' into file_create.
    DATA: l_xml_table TYPE TABLE OF xml_line,
    l_xml_size TYPE i,
    l_rc TYPE i.
    select * from catsdb into table itab.
    append itab .
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
    EXPORTING
    I_FIELD_SEPERATOR =
    I_LINE_HEADER =
    I_FILENAME =
    I_APPL_KEEP = ' '
    I_XML_DOC_NAME =
    IMPORTING
    PE_BIN_FILESIZE = l_xml_size
    TABLES
    i_tab_sap_data = itab
    CHANGING
    I_TAB_CONVERTED_DATA = l_xml_table
    EXCEPTIONS
    CONVERSION_FAILED = 1
    OTHERS = 24
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD cl_gui_frontend_services=>gui_download
    EXPORTING
    bin_filesize = l_xml_size
    filename = file_create
    filetype = 'BIN'
    CHANGING
    data_tab = l_xml_table
    EXCEPTIONS
    OTHERS = 24.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    write : 'INTERNAL TABLE DATA IS SUCCESSFULLY DOWNLOADED TO LOCATION', file_create .
    Thanks.

  • How to read a file containing bitmap message in binary format

    Dear all,
    Can anybody tell me how to read bitmap message which stored data in binary format? The messages are stores like this :
    A file contain some messages along with these bitmaps in square zeroes.
    I want to again convert it into ASCII.

    Double post: http://forum.java.sun.com/thread.jspa?threadID=587497

  • How to read 16-bit signed integer in binary format with 2 byte sync. preceding??

    A flowmeter provides data as 16-bit signed integer in binary format with 2 byte sync. preceding
    I got i small problem by understanding the synchronasation.
    I read the data provided by the flowmeter, and then write it to a binaryfile.dat. i need to convert the data to decimal format. is it better to convert the data before or after writing it to the binary file. Coz i need to read the data out again for calculations and save it again in a new file.
    I understand that the synchronization  help one to see where to begin reading the usable data. is it right?
    Need any suggestions
    Thank you !
    Zamzam
    HFZ
    Attachments:
    DataOut.JPG ‏37 KB

    HI Rolf.k.
    Thank you for the small program it was helpfull.
    You got right about that proberly there  will be conflict with some spurios data, I can already detect that when writing the data to a spreadsheet file.
    I writes the data in such a way, that in each line there will be a date, a timestamp, a tab and a timestamp at the end. That means two columns.
    When i set given samplerate up, that controls the rate of the data outflow from the device, (1,56 Hz - 200 Hz),   the data file that i write to , looks unorderet.
     i get more than one timestamp and severel datavalues in every line and so on down the spreadsheet file.
    Now the question is: Could it be that the function that writes the data to the file,  can't handle the speed of the dataflow in such a way that the time stamp cant follow with the data flowspeed. so i'm trying to set the timestamp to be  with fractions of the seconds by adding the unit (<digit>) in the timestamp icon but its not working. Meaby when i take the fractions off a second within the timestamp i can get every timestamp with its right data value. Am i in deeb water or what do You mean!??
    AAttached Pics part of program and a logfile over data written to file
    regards
    Zamzam
    HFZ
    Attachments:
    DataFlowWR.JPG ‏159 KB
    Datalogfile.JPG ‏386 KB

  • How to convert Xstring to PDF format and send pdf to multiple user

    Hi to all
    can any one provide me saple code to convert Xstring to PDF format and send pdf to multiple user
    i have searched the SDN , but cant get any proper soulution.
    I shall be thankful to you for this.
    Regards
    Pavneet Rana

    Use function module 'SCMS_XSTRING_TO_BINARY' to convert from XString to a Binary table. Just like this:
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer          = lv_xstring_pdf
          append_to_table = ' '
        TABLES
          binary_tab      = lt_doc_content.
    To send the email in an OO way you should user class CA_SEND_REQUEST_BCS. Take a look to program BCS_EXAMPLE_6 or any of the test programs in package SBCOMS.

  • How to convert XML to Binary in OSB Message flow

    Dear All,
    Can you please help me in converting XML to Binary in OSB Message flow.
    Please help.
    Thanks,

    ah ok, then you have to apply a transformation from XML to some fixed length format, EDI style
    probably you have 2 options: the traditional MFL
    http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/consolehelp/mfls.html
    or the (probably) more supported nXSD with a JCA adapter
    http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/nfb.htm
    I will let you digest this info and then we can continue.
    There are a number of threads in this forum on whether one technology is better than the other (as usual, google can assist you)

  • Data Acquisition form single precision to binary format

    Hi everybody,
    I work in an Astrophysics group and I'm developing an acquisition system of signals generated by X-Ray detectors (Transition Edge Sensor).
    I'm trying to save data acquired by NI-PXI 6132 (DAQ-mx software in LabVIEW 8.0) in binary format.
    To do this, I use the 'Write To Measurement File' procedure.
    I don't know how it is possible to change the precision from the DBL to SGL directly from DAQ-mx, but I solve this point by creating a 'For Loop' inside my VI, after the data is acquired.
    The problem is that I try to save the SGL data with the previous procedure but the 'Convert To Dynamic Data' automatically occurs, and the data are saved in binary format but in doube precision. So, the previous conversion that I made from DBL to SGL does not work.
    How can I solve this problem?
    Thank you for your help!
    Ciao,
    Claudio!

    Hi Alessio,
    thank you for your prompt reply!
    In attach there is the VI you reqeusted me.
    Ciao,
    Claudio
    Attachments:
    Daq_2monitor_BINARY_ASCII_single_float.vi ‏498 KB

  • Convert Rawstring to Binary

    Hi All,
    I have a field of type rawstring and it should be converted to binary format.
    Please let me know how to convert? is there any function module available?
    Thanks & Regards,
    Moni

    Hi, Moni
    The following links may help you in this way, Please have a look,
    [Mapping of the ABAP Data Types |http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f2f2446011d189700000e8322d00/frameset.htm]
    [Rawstring|Re: How to store Rawstring to itab & 'strlen' not working for Rawstring ?;
    [XTSRING to Binary|Re: XTSRING to Binary Problem]
    Kind Regards,
    Faisal
    Edited by: Faisal Altaf on Jan 28, 2009 10:59 AM

Maybe you are looking for