File comparaison works on win32, not on unix solaris

Hi all!
I have the following code comparing 2 files. It works on win2000 but doesnt work on unix solaris.
     private boolean fichierIdentiqueBytePourByte( InputStream in1, InputStream in2 ) throws IOException{
          int a = 0, b = 0;
          while(true){
            // read next byte from both stream
            a = in1.read();
            b = in2.read();
            // if its different then files are different and we are done
            if (a!=b) return false;
            // if both are at eof then all checked must be the same
            if (a==-1&&b==-1) return true;
            // if either are at eof then they are different sizes
            if (a==-1||b==-1) return false;
     }any ideas of what the problem might be?
Thanks

418nic wrote:
Hi all!
I have the following code comparing 2 files. It works on win2000 but doesnt work on unix solaris.
     private boolean fichierIdentiqueBytePourByte( InputStream in1, InputStream in2 ) throws IOException{
          int a = 0, b = 0;
          while(true){
// read next byte from both stream
a = in1.read();
b = in2.read();
// if its different then files are different and we are done
if (a!=b) return false;
// if both are at eof then all checked must be the same
if (a==-1&&b==-1) return true;
// if either are at eof then they are different sizes
if (a==-1||b==-1) return false;
     }any ideas of what the problem might be?
ThanksWell, from your code, you only have two traits that this depends on to work--comparing int's and EOF. You have hard coded a -1 for EOF into this, I am not completely familiar with EOF condition on different platforms, but I know int's compare without error on every platform. Do a debug and a breakpoint set to stop just before you think you're going to get an EOF and I think you'll see, that the EOF you are using is the actual problem.

Similar Messages

  • File comparaison works on win32 JVM, not on 64bit solaris JVM

    Hi all!
    I have the following code comparing 2 files. It works on win2000 but doesnt work on unix solaris. (same JVM version)
    win32 JVM is 32 bit, solaris JVM 64 bit
    private boolean fichierIdentiqueBytePourByte( InputStream in1, InputStream in2 ) throws IOException{
              int a = 0, b = 0;
              while(true){
                // read next byte from both stream
                a = in1.read();
                b = in2.read();
                // if its different then files are different and we are done
                if (a!=b) return false;
                // if both are at eof then all checked must be the same
                if (a==-1&&b==-1) return true;
                // if either are at eof then they are different sizes
                if (a==-1||b==-1) return false;
         }any ideas of what the problem might be?
    Thanks

    Presumably when you say it didn't work you mean that in one case it returned true and in the other it returned false.
    If something else then you need to explain what it is.
    Naturally one obvious source of the problem is that in fact the files are not the same on the 64 bit machine. For example they were transferred using ftp and one was transferred using ftp text and other via ftp binary. Then the lengths would be different.
    Another possibility is that you are not running the code that you think you are.
    If the files are very large then it is possible there is some difference there.

  • Image not showing in XML Publisher [works on windows, not unix]

    I have an xml publisher RTF template that references an image from a URL passed in from the xml data file. The report definition references the image as follows:
    <fo:external-graphic>
    <xsl:attribute name="src">
    <xsl:value-of select="//fld_FILE_PATH_NAME"/>
    </xsl:attribute>
    The XML produced for the report correctly contains one single element to resolve to the URL:
    <fld_FILE_PATH_NAME>file:////i01_02/psoft/90/finsys/appserv/FSDSYS90/files/OZ57_EX_E0445_0000000303.png</fld_FILE_PATH_NAME>
    When running in PeopleSoft on a windows application server the process works fine and I can see the image. When I run this in our unix solaris environment, PT 8.49, the report runs but the image does not display. I have checked that the image does exist in the correct location I ran firefox in gnome and pasted the file location below and it resolved fine.
    I am referring to the file using a 'file' URL as follows:
    file:////i01_02/psoft/90/finsys/appserv/FSDSYS90/files/OZ57_EX_E0445_0000000303.png
    Any ideas?
    Glenn

    OK, this was a confusing one, and I suspect is a bug.
    In the end, after using the xdo.log [debugger], we saw that the xml publisher engine is stripping off two slashes as the beginning of the URL construct. So, the solution, is to add two additional slashes.
    So, the URL which ended up working is:
    file://////opt/oracle/90/findev/appserv/FSDDEV90/files/OZ57_EX_E0445_0000000303.png
    which resolves to the file /opt/oracle/90/findev/appserv/FSDDEV90/files/OZ57_EX_E0445_0000000303.png
    FYI - our environment is Solaris 10 using the Oracle Application Server, PT 8.49

  • TS3212 i downloaded itunes on my windows 7 computer, but when i try running the setup file, it says it's not a valid win32 file. how do i fix this?

    i just bought a brand new HP computer with the windows 7 and i'm trying to download itunes on my computer. I've used the email and a new one for the download. it'll go through the process of downloading the itunes setup, but when i go to the downloads folder in my computer and click on the file, it says it's not a valid Win32 file and won't open.  I've tried downloading the 64 bit version to se if that was the problem, but even that won't work.  please help!

    Perhaps try downloading and saving a copy of the installer to a different PC. (If you're on a 32-bit Windows system, try to download on a different 32-bit Windows system.) Copy the iTunesSetup.exe installer to an external hard-drive, or a large-enough thumb drive or burn it to a CD-R. Carry the installer back to your PC, copy the installer to your hard drive. (Don't run the install from the ExHD, thumb or CD-R.) Start the install by doubleclicking the iTunesSetup.exe file.

  • I can't get download to work - it will not copy the mp3 file to my chosen location (as set in tools/options) - it gives me a new window with a player - no dwnlo

    I am running windows xp sp2 and I have set my dowload location under (tools/options), but when I select an MP3 file to download, firefox does NOT copy the file to my chosen location on my HD - instead, it opens up a new window with a makeshift "player" and begins loading the player with the MP3 file. The problem is that I have no idea where on my system firefox has copied this file to, so, I cannot leave and come back later and play this MP3 file using winamp. I have to listen to it right then or lose it - if I close that new window (with that puny little "player"), then I lose the download, wherever firefox put it on my PC (I got no idea where it is). This is all under firefox 25.0
    I am also running FIrefox 12.0 on an older windows 2000 machine and that works perfectly - I can download any MP3 file I want, and firefox 12.0 (on win2k, sp4) downloads it to my chosen location (on my HD), and it gives me the download window so I can watch its progress and have some control over pause, and resume, and, when it is done, the download window offers me the option to "open containing folder" so I can make sure it got to where I wanted it. In other words, Firefox 12.0 on WIn2k, sp4 works better than firefox 25.0 on winxp sp2!!!!! What gives? I went through and set up my options for XP just like I did with Win2k and it all looks good, but firefox 25.0 just ignores my chosen location and always defaults to give me that makeshift player and I am not able to actually copy the mp3 file to my harddrive - it makes firerox 25.0 almost unusable since downloading mp3 files is a big part of my firexfox use - please help - I am not able to upgrade windows at this time, and, since firefox 12.0 still works fine on win2k, I can't understand what happened at firefox?

    Phillipp,
    I tried it again using "save link as", and this time it actually worked! I just now downloaded several more using the "save link as" option, and it works perfectly. Thanks. Problem solved.
    Littleberry

  • File Upload UI element is not working properly inside Table Popin container

    Hi Expert,
    I created a table with popin, i placed file-upload UI element inside table popin contatiner.
    The file upload UI element is displaying properly but, when i click the browse button to select  the file, the file open dialog box is not popping out.
    will table popin support file-upload UI element inside it?
    it not is there any other way to call a file_open dialog box from inside the table popin.
    Thanks,
    James

    If you are on NetWeaver 7.01, you can try both the ACFUpDownload UI element or try creating your own FileUpload in Adobe Flex with Flash Islands.  ACFUpDownload requires the KPRO by default (which is why the same application isn't working for you), but you can write your own handler class to act as the KPRO receiver.  Here is an eLearning on the topic:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/109b9b52-bc00-2c10-8786-e4c5e96d7e04
    and source code:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70645070-bb00-2c10-f086-f126721acdb4
    If you want an eLearning on the FlashIslands approach, you can find it here as well:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50d42644-91ef-2b10-228c-9e0ae75b274e
    and Source Code:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f044b62c-90ef-2b10-64a6-9ec25294d133
    However in both of these approaches you still have to be careful with how you handle large files.  The problem is that they are processed often a single binary string.  This makes the processing easy, but requires total amount of session memory at least as large as the file being uploaded.  In NetWeaver 7.02 ABAP adds the concept of Streams and Locators to help with the partial processing of large files.  This feature doesn't come until later this year, but if you are interested you can learn about it here:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80f983df-213e-2c10-ba89-b5a12ef178e8

  • JInternalFrame not opening in JAR file, but works when not in JAR

    I have a folder that contains multiple .class files. I make all the class files into one jar file with this command:
    jar cmf mainClass.txt myapplication.jar *.class
    The mainClass.txt contains the following:
    Main-Class: myapplication
    class-path: myapplication.jar
    The myapplication.class opens up a JDesktopPane inside a JFrame. It also contains a start menu, which again has elements that opens up misc JInternalFrames inside the JDesktopPane. The problem is this:
    When I run the application from a .bat file, everything works fine. However, after making the JAR Executable file, everything works except 1 JInternalFrame. Now, the code for this JInternalFrame is far too much to post, so I'll have to ask as follows;
    Are there any reason why a JInternalFrame would not work from inside a JAR Executable, but work when not in the JAR file? Especially when other JInternalFrames are working? What can make 1 JInternalFrame different from the others in this regard?

    Perhaps the problem lies somewhere else.
    Obviously if other JInternalFrames are working then there is a difference in the one missing internal frame that causes it not to show up.
    My guess is that perhaps you are missing one or two classes in your JAR that are used by that JInternalFrame and that an exception is being thrown causing it not to show.
    Double check the contents of your JAR and make sure that all the classes are present and that they are the right versions.

  • How to fix file when it says, "Cannot open file " ". Adobe Indesign does not support the file format, a plug-in that supports the file may be missing, or file may be open in another application." It worked one second, I saved and closed the file, then tri

    How to fix file when it says, "Cannot open file " ". Adobe Indesign does not support the file format, a plug-in that supports the file may be missing, or file may be open in another application." It worked one second, I saved and closed the file, then tried to reopen and now it won't work. I am using Adobe InDesign CS5. It is the only version on my comp. I have tried opening on another comp & copying the file – same error comes up. PLEASE HELP

    First check the version of the document with Jongware's script "Identify.jsx" (ExtendScript/JavaScript).
    You can find it here:
    [Ann] Identify Your InDesign File
    If it is CS 5.5 or above, you need someone to open it in the version the script says and export an IDML representation from that. Another way would be to install a 30days version of CS6 or above (CC) and do it yourself.
    In regards of the script showing a result for InDesign files higher than CS6:
    CS7 = CC v9
    CS8 = CC v10 = CC-2014 or CC2014.1
    Uwe

  • Why while in Bridge Load Files into photoshop Layers does not work?

    In Bridge, Tools>Photoshop>Load Files into Photoshop Layers does not work.  I have two images selected and when I execute that comman in Bridge nothing happens.  I exited and restarted both PS and Bridge and still nothing.  I am working in Windows 7 and Photoshop cs6.

    No I tried File/scripts/load file into stack and still did not work.
    There was an update to bridge and now it works.  Thanks so much.

  • File Upload Action Button are not working

    Hi  ,
    In the File Upload Process when the processor are open change request there are Action Buttons  Approve/Reject ,
    When the CR Processor are Click on either Approve or Reject  these two Action Button are not working (means its not show any activity) , while rest of all action button like save,close check , Run validation  are working ...
    While Processor has authorization to Approve/Reject that CR ...

    Hello Nikhilesh
    These buttons are dependent upon the workflow steps. Check that. Check the linkage for workflow. Check SWI6 - CR number and the step. Based on the step you can identify whether the proper step is assigned or not.
    Thanks
    Kiran

  • Javascript multiple file upload with progressbar does not work in firefox, please help

    I want to upload files using this javascript snipped as well as processing non file fields on the same form. This works beautiful in IE11, Chrome and Opera, but not in firefox (version 34).
    I fired the non file handler with the action attribute on the <form> like this:
    <form id="upload_form" enctype="multipart/form-data" method="POST" action="nonFile.php">
    and the javascript with:
    <input name="submit" type="submit" style="background: green" value="Submit" onclick="return uploadFiles()"/>
    When I change type="button" the file uploads work in FF but the I have no control over the non file fileds.
    Can someone gives me an indication of what is wrong?
    oXHR.upload.addEventListener("progress", function(e){
    var percent=(e.loaded/e.total) * 100;
    _(idProg).value = Math.round(percent);
    _(idstat).innerHTML = filename.name + " "+Math.round(percent)+"% --- Please Wait";
    }, false);
    // Upload finish, show the size of the file in Bytes, KBytes or MBytes
    oXHR.onreadystatechange = function(){
    if (oXHR.readyState == 4 && oXHR.status == 200){
    var iBytesTransfered = bytesToSize(filesize);
    _(idstat).innerHTML = filename.name + " Size: " + iBytesTransfered + " "+100+"%";
    _(idProg).value = 100;
    // Upload failed
    oXHR.addEventListener("error", function(e){
    _(idstat).innerHTML = "Upload Failed";
    }, false);
    // Upload aborted
    oXHR.addEventListener("abort", function(e){
    _(idstat).innerHTML = "Upload Aborted";
    }, false)

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0, 0,0" width="600" height="360">
    <param name=movie value="example.swf">
       <param name="allowScriptAccess" value="always" />
    <param name="quality" value="high">
    <param name="allowScript" value="opaque">
    <param name="wmode" value="opaque">
    <embed src="example.swf" quality="high" allowScriptAccess="always" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Shockwave Flash" type="application/x-shockwave-flash" width="600" height="360"></embed></object>

  • File sharing with 3 computers, working partially but not entirely

    I have three computers on my network and file sharing works only partially. Here's my problem:
    Computer 1 can connect to Computer 2 and 3
    And, vice versa, Computers 2 and 3 can connect to Computer 1
    So file sharing is obviously working, to a certain extent, on all three.
    BUT ... I cannot get file sharing to cooperate between Computers 2 and 3. i.e. I browse for networks on 2 or 3, and the only thing that appears is Computer 1.
    Computer 1 (the cooperative one) is an iMac 10.5.8. The other two (naughty) ones are Mac Pros, on Mountain Lion.
    Thoughts anyone?

    I have a similar setup.  One iMac with 10.5.8 and 2 Mac Pros running Mavericks.
    Networking the three of them with OS X has not been problematic in my case.  I can't imagine why the 2 Mac Pros won't see one another.
    Have you tried adding 'shared folders' in the System Preferences/Sharing/File Sharing for both Mac Pros?
    You could also try to 'force' a connection with Finder's 'Connect to Server' (Command-K).  Just enter AFP:\\your_mac's_IP_address.
    I've even managed to get all three macs to network with Windows and Linux (though it's not as smooth as connecting to other Macs, obviously).
    Best of luck.

  • Power book G4 Leopard 10.5.8. File sharing preference checked but not working after start up until unchecked and the rechecked?

    I hope the title is enough info, please ask. In the mean time I have created an applescript to open preferences/ sharing and uncheck then check the file sharing box. This works but I would obviously prefer it just work normally. I have no corrupt preference files. Perhaps a file is missing? Thank you.

    Greetings Kwnez
    I'm not up to your level of expertise yet. I'm networking and file sharing too, on my Mac Powerbook 1.33 GHz PowerPC G4; OS 10.5.8 Lepoard. At the public library I found by asking the clerk a book Authored by David Pogue. "Mac OS X Leopard the Missing Manual". It (the book) has helped me ask better questions. I'm not saying that your question "
    Power book G4 Leopard 10.5.8. File sharing preference checked but not working after start up until unchecked and the rechecked?
    is hard for me to understand, I went to system preferences and looked at the sharing box. when I clik it it opens up and the first thing I see is my computers name, and under that i see, " Computers on your local network can access your computer at: ...-powerbook-g4-15.local"
    What I'm saying is "Are we on the same Page"

  • C# Script to copy an Excel File working locally but not on the server when I schedule a job

    So I have these couple C# commands to copy an Excel File which works fine and dandy on my local client when I test and run this SSIS Package but when I tried scheduling the job on the server, it failed.
    These are the couple C# commands...
    // This Opens the Source .xlsx File from Emdeon ePaySmart
    Workbook workbook = excelApplication.Workbooks.Open(StringSourceFile, XlUpdateLinks.xlUpdateLinksNever, true, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
    // This will Save the Source .xlsx Emdeon ePaySmart File as a .xls File...note xlFileFormat.xlExcel5
    workbook.SaveAs(StringDestinationFile, XlFileFormat.xlExcel8, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
    Is this because I'm using xlFileFormat.xlExcel8 and locally it is running fine but when I schedule via SQL Server Management Studio as a SQL Server Agent Job it seems to be failing??
    I sure hope I don't have to change this so it will run as a SQL Server Agent Job and/or run this locally every blessed week.
    Can someone clear this up for me and provide a potential solution?
    Thanks for your review and am hopeful for a reply.
    ITBobbyP85

    That is Excel automation, which requires Excel to be installed on the computer where the code runs, and is not supported on a server without an interactive user logged in.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • [Photoshop CS5] Optimize to File Size working not correctly.

    ******BUG******
    Concise problem statement: Optimize to File Size working not correctly.
    Steps to reproduce bug:
    1. Open any photo.
    2. Draw a slice
    3. Save For Web, choose Optimize to File Size, type 10KB (Current Slice).
    4. Save "selected slices" only
    Results: File result larger than expect (over 10KB)
    Expected results: <=10KB filesize.
    I uninstalled whole Adobe CS5 Master Collection (Trial) & tried to reproduce the bug in Photoshop CS4, but it was not happened, it's ok on CS4.
    Finally, Windows 7 is not reason, it's a bug of Photoshop CS5. Please fix, I don't want to buy a bugged software.
    I really need the feature "Optimize to File Size" in my works.
    P.S: I tested on 4 PCs, and the results is the same.

    In the SFW dialog change the Metadata dropdown to None

Maybe you are looking for

  • Invalid Color Space error after update Reader to 9.3.3

    After updating Adobe Reader to 9.3.3 I run into the Invalid Color Space error when trying to open a PDF file created with CorelDraw 12 in the format PDF/X-1A.  This format needed by a printing office to print the file. The strange thing is that Reade

  • Read file latest entry with time stamp from unix

    Hi I have a log file which is being generated with an entry  like this Product20080228185707,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS, Product 20080229151029,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS, Product 20080320163241,TRANSPORTED,86206

  • AppleTV; Audio no Video

    Does anyone have the issue of no video, but audio, streaming to their AppleTV from their iPad? I have gone to web sites such as ESPN and have tried to stream to my AppleTV and all I get is audio and no video. Any help out there?

  • Batch-specific Unit of Measure

    Hi, What is Batch specific UOM? How do we configure in ECC 5.0? My requirement is as follows - 1. GR qty should be in Base UOM (Kg) and Bags 2. The qty/bag = 95 Kg (standard / Alt UOM) for material 3. However, for shipment received Qty/Bag may very (

  • FCP Ignoring rotation bit

    Morning, Imported P2 Data from HVX using the RedRock system so the image comes in upside down. Opened clip in Quicktime Pro, under Show Movie Properties, selected video track/visual settings. Rotated the clip so it views correctly now. Save the clip,