Same file is different on different OS'es

Hallo,
I am having the following problem. I am reading a file (image, sound, whatever) with the code below, and depending if it runs on windows or different linux versions some bytes are always different when reading the very same file. I really don't know why. Has someone had a similiar problem and knows a solution? Please answer...
public void load(File file){
          try{
               this.fistream=new FileInputStream(file);
               this.distream=new DataInputStream(this.fistream);
          catch(FileNotFoundException ex){ex.printStackTrace();}
          catch(IOException ex){ex.printStackTrace();}
     public int nextChar(){
          try{
          if (distream.available()!=0)
                    return distream.read();
          catch(IOException ex){ex.printStackTrace();}
return -1;
Thanks a lot
Max

Homer_Sanchez wrote:
I'm doing following. I want to create a "random" byte sequence from an arbitrary file. This sequence should be same everytime it's created from the same file. But this isn't the case this way. Windows XP gives different results than for example mandrake linux. Everything that's already been said still holds.
So in essence this means, I don't need any binary data. What? This makes no sense. I have no idea what you're talking about here, but it seems to contradict everything you've said so far.
The name nextChar() was just a name. It shouldn't mean anything.No, it should clearly and concisely describe what the method does. Don't expect others to read your code if you can't make the effort to make it make sense.
But does the InputStream method in the code skip carriage-return and line-feed characters? No, it does not. The phrase "carriage-return and line-feed characters" is only meaningful when dealing with line-oriented text data. Read what we already said.

Similar Messages

  • How to configure a scenario which posts same file to different directories

    How to configure a scenario which posts same file to different directories of a receiving system?
    Consider an Idoc to file scenario where I have to post same file to two different directories but logical receiver system has to be same.

    Hi,
    You can try out like this: Using multiple receiver interfaces you can send it to multiple directories with the help of enhanced interface determination/conditions and with the help of multiple receiver communication channels.
    Another option is to copy the file from one target directory into another directory  with the help of Unix script by executing the same from the OS command level.
    One more option is to create a Java Server Proxy and inside the proxy, you can write java code to FTP into different locations.
    Hope this helps,
    Regards,
    Moorthy

  • Two machines saving the same file as different sizes?

    My coworker and I both have the same version of Illustratir (CS6) and both use Lion on iMacs, but today noticed something weird. He saved a file similar to a file I had done before as both an eps and a pdf and his file size was more than twice what my file sizes usually are. I thought it was odd, so I copied everything from his file into a new file (same dimensions) and saved out an eps and pdf (default settings), and like I thought, my files were less than half the size of his.
    Why would two machines be saving identical files at different sizes? Is there a setting somewhere I'm missing? Everything in the file is vector, if it matters. There's not even any editable text.

    See the mechanism of saving here: http://superuser.com/questions/66825/what-is-the-difference-between-size-and-size-on-disk
    The size of the "blocks" depends on the size of the disk and how it's been formatted.

  • Same file name - Different extension - Viewing problem

    I know this has been written about quite a bit and I have searched through the posts but I cannot find a solution to my problem. I shoot RAW, import then into Lightroom, make changes, import into CS3 & make more changes, save as a .psd file; no problem so far. I use Neat Image on some files that need the noise reduction so in CS3 I save the .psd as a .tif, run it through Neat Image and save it to the same directory where the RAW and .psd files are. Go back to Lightroom and no .tif file. If you "find" the file in Lightroom it shows up but shows as the .psd file. I have tried unstacking and everything else I can think of but I cannot make the .tif file display. I can go back to CS3 and locate the file through it but if in a few months or however long it takes me to forget that the .tif is there, the .tif will be lost in never never land. Bottom line, how do I get Lightroom to show ALL files, no matter name, extension, etc?
    I am using Version 1.3.1 on Windows XP, 2Gigs ram, 3.4 Gig P4 processor

    This issue was argued down to skeletal remains in beta and after. Adobe finally rlented somewhat and allowed the importation of files with same name and the RAW and jpeg extensions, because for one good reason some cameras produce both and some shooters utilize both for differring purposes.
    Jao,
    I will disagree with your reading of what is standard. That MS's stupid explorer or anything else won't show extensions is immaterial. First, anyone wanting to work at any speed and efficiency will be using something like Total Commander instead of Explorer, and it and virtually every other app I own shows extensions and treats files with the same name but differing extensions as unique files unto themselves--as it should be.
    After all it is digital data in the file that is unique. The extension is a tag to tell you and the computor how to deal with that data. The content is not identical, and therefore it ought not be treated as if it were by any application.
    Anyone with an interest in wasting several hours can trace the arduous wailing at the LR team to treat the extension as part of a unique name. As I said bdefore, they did make some concessions. Hopefully, they will go the whole distance soon.

  • Get Info sees different "Open With" for the same file on different computer

    I've got a laptop (17") and a desktop, both with OSX 10.4.3. I had a disk problem with the laptop, but was able to get everything off the disk, reformat it, and put it all back. Everything's been working fine until today, when I tried to use the Equation Editor in Office. It wouldn't work. As I tried to chase down the problem, including reinstalling Office, I realized that my laptop was seeing certain Office files using GetInfo as "Open With" Netscape. I compared this with the settings on the desktop, and they were different. Different applications, different icons, even.
    Then I noticed that when I have the CD in the laptop and do GetInfo on a file there, or even look at the icon, it's different from what appears when I look at the same file on the desktop. So it appears to be an OSX issue, not a Microsoft issue.
    I've rebuilt permissions several times. I changed the OpenWith settings, but that didn't solve the problem. But I think it's because other Office files are being misread by the OS, too.
    If anyone has a diagnosis (and hopefully, a cure), I'd really appreciate it.

    Hi, Jim.
    You wrote: " I realized that my laptop was seeing certain Office files using GetInfo as "Open With" Netscape."If you are seeing more than just Office documents displaying the incorrect default application, this could indicate a corrupted Launch Services cache or preferences on the affected Mac.
    In associating documents with applications, Finder employs Launch Services. Launch Services employs several files to associate documents with applications and vice versa. When these files become corrupted, this can result in problems including:
    - The wrong applications being launched when double-clicking a file.
    - Multiple copies of a single application appearing in the Open With menu for a given document.
    - Incorrect icons appearing on files, folders, or other objects.
    The following steps will remove all of the files used by Launch Services. Be sure to read these instructions entirely, including the Notes, before proceeding.
    1. Quit all running applications.
    2. Trash the following two files in the Computer > Macintosh HD > Library > Caches folder:
    - com.apple.LaunchServices-0140.csstore
    - com.apple.LaunchServices-014xxx.csstore
    where xxx is the uid number for the affected account in the NetInfo database. Type your Admin password when prompted to authenticate the deletion of the first file. See Notes [1] and [2].
    3. Trash the com.apple.LaunchServices.plist file in your Home > Library > Preferences folder. See Note [3].
    4. Restart your Mac.
    5. Log in to your account.
    6. Empty the Trash.
    Do not empty the Trash until after you have restarted your Mac.
    Notes:
    [1] Step 2 will result in you being prompted to approve the launch of the application associated with a document the first time you double-click a document. These alerts are a result of the security feature in Mac OS X. The list of applications which you have previously approved are saved in the caches deleted in step 2.
    [2] The first user account defined on your Mac is generally uid 501, the second uid 502, and so forth. For example, the second file ID for the first account would becom.apple.LaunchServices-014501.csstoreYou can find the uid number for any account as follows:1. Launch NetInfo Manager, which is in the Computer > Macintosh HD > Applications > Utilities folder.
    2. Select users in the middle column of the NetInfo Manager window.
    3. Select the desired user account in the right column of NetInfo Manager.
    4. The data for the selected user, including uid, is displayed in the lower pane of the NetInfo Manager window.[3] Step 3 will reset to default values all associations you have created between specific file types and applications. For example, if you set PDFs to open in Adobe Acrobat instead of Preview, they would now open in Preview again until the association of PDFs with Acrobat is reset. You may want to skip step 3 to see if the other steps resolve the problem. However, if skipping step 3 does not resolve the problem, running steps 1-6 again, including step 3, should resolve the problem.
    Note that some of the information above is from the "Applications" chapter of my book, Troubleshooting Mac® OS X, Tiger Edition.
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • Same files, two different play sequences

    This is probably a stupid question, but I don't know DVD Studio that well.
    The situation:
    I have 8 separate video files.
    They need to be able to be played individually (coming back to a menu at the end of each video), and to be played through completely (when a "play all" button is selected).
    I want to reference the same files to keep the highest quality.
    Help?

    There is something called "end jump" or something (my version is in French, can't tell you for sure).
    This is where you tell the DVD where to go when it's finished playing (example : go back to the menu, or jump to the next of your 8 tracks)
    There is another thing called a story.
    Here, you tell what chapters the DVD should read in an alternative order.
    So maybe we can imagine that you have chapter markers almost at the end of each track.
    You make 8 stories (that's the way it works) in which you drag the first chapter of each track (remember, the second chapter is only a few frames, it's almost at the end). So when a story plays, it only plays most of the trak.
    Then you tell it what to do when it gets to the end of each story (made up of most of each track)
    What you tell it, is to jump to the next story.
    So this is your architecture :
    Tracks 1 to 8 have chapter 1 and 2 (2 being almost at the end) and at the end of the track it jumps to the menu
    Stories 1 to 8 which only contain chapter 1 from each track and who jump to the next story at the end.

  • Two hard drives with exact same files showing different sizes

    I have two WD external drives, one which I'm trying to dedicate solely to Time Machine backups.  In transferring data from the one I intend to use for that purpose to the other, I'm finding that all the files transferred but that the folders register as having different sizes (e.g. one video folder has the same number in each, but on the original disk it was 4.43 GB in total and is only 4.26 GB on the new disk).
    I've read that there could be hidden system files that didn't move, but if that's the case does it matter?  Both drives are the same model but are differently formatted.
    Thanks

    but are differently formatted.
    That could be the cause. Files are not written to a disk in bytes, they are written in blocks that are a minimum size. For instance, if the minimum block size is 1KB, the a 5 byte file will occupy 1KB on the disk. So, depending on the block size of the drive format, you may get different results.

  • Font in pdf and in Ai are different. Same file but different font.

    Hi
    I have trouble with font in illustrator and pdf.
    A customer sent me both Ai and Pdf files, the text are totally different.
    When I open the illustrator there is one font (Arial Narrow Bold), but when i view the pdf using adobe acrobat the text has changed to another font (Myriad Roman).
    The correct font is Arial Narrow Bold.
    It is very unprofessional to ask customer everytime what font they are using when they already provide me the Ai files.
    I want to know what happen when converting to pdf. Are there any setting in pdf I should be aware of ? so I can tell customer next time to avoid this mistake. 
    Pls help I really need to know the answer to this. Thank you so much!!

    Hi Mylenium,
    Thank you for your reply.
    Can you let me know where is this setting and what to select or deselect??
    Thanks so much!

  • Same file is different sizes on differently formatted external HDDs

    First question: I have two external drives; one is formatted for MS-DOS File System (FAT32) and the other is Mac OS Extended (Journaled). When I copy a folder from the DOS drive to the OS X drive, the folder is a different size on the two drives. Is this normal? Is there any chance that some of the data is missing or corrupted? If it's normal. is there a way to calculate what the difference should be so I can feel comfortable erasing the DOS drive once I've transferred everything off it.
    Second (sort-of related) question: if I don't care to use my external drive with a Windows PC, what is the BEST format for the drive? Why? If I do want to use the drive with a Windows PC, what is the best format? Why?
    Thanks so much wonderful and helpful other Mac users!

    Hello! The different file sizes are normal in my experience. If you want to use it with both MSDOS is the only way but if Mac only the Mac HFS+ JOurnaled is best. Tom

  • Share the same files to different users over the network

    Hi,
    I have a server running in my home network and want to share my photos accross the network. The photos have to be accessable from linux and windows clients and from different user accounts. The filesystem to share is btrfs right now. I would like to stick to it, but if this should turn out to be an issue, I will change it to s.th. else. I could use samba with a dedicated samba user or ftp, but both solutions feel hacky to me. Is there a better approach to the problem?
    Thanks,
    Wolfgang
    Last edited by ReedWood (2013-09-13 08:32:26)

    Personally I'd go with an ftp server since I got that to work in the past but samba might do a decent job, too (don't know, never used it). But you can also just set up a web server to share your pics (maybe with a nice gallery web app?). The technology used itself does not matter that much.
    Now, on to the important question: What about security? Do you need some kind of authentication or can you get away without any login stuff (since no bad guys can connect to your network anyway)?
    FYI I used vsftp and pam as described at http://www.cyberciti.biz/tips/centos-re … users.html to get my ftp server running. You might be able to expand this to other solutions as well. I had to password protect my ftp server since I wanted to have write permission, too. For read only I might have been fine with anonymous ftp back then.

  • Creating same files on Different FTP Locations

    Hi All,
    My scenario is like this
    IDOC which is coming from SAP has to be sent to two FTP locations (XYZ20082210.dat both same structures)...
    Can any one please give me the best approach to handle this...
    I know i can do this by creating in two ways
    1) Using 1:N mapping 
    but this also i dont think the right approach as i need to duplicated the same Message Type and rename into 2 Message Type and use in the 1:N mapping.
    2) creating 2 Message Mappings and two Interface mappings and two recievers ..
    But this one XI processess the Mappings two times which is not good as we recieve multiple Idocs at a time...
    Please suggest me a suitable approach for which way i can achieve by more Optmizing ...
    Thanks and Regards,
    sridhar reddy

    Hi Sridhar,
    If you want to work out this issue using OS command, then you configure your receiver file adapter to place the file in one folder say 'Source' . Let your two destinations be Target 1 and 2 in the network. Paste the below two lines in notepad, edit the path names and save as .bat extension.
    xcopy D:\Source\.* "
    NetworkPath\Target1"*
    xcopy D:\Source\.* "
    NetworkPath\Target2"*
    If you receiver folders are in Windows network :
    You should run the above mentioned bat file to copy your messages to the destination in network.
    Note :  XI can NOT execute a OS command/ shell script on the receiver FTP server. The OS Command for the file adapter only runs on the system in which the Adapter Framework is running.
    If you receiver folders are in FTP Server :
    Refer this link : 
    http://www.circa.ufl.edu/handouts/networks/ftp.html

  • Opening the same file in by different users

    As a newbie to InDesign I got a workflow question.
    Working with a team of 6 designers, we would like all to work in the same InDesign document. We need to create a big salebooks book, therefore it is necessary to open the same file in different copy of indesign?
    Currently we are working with CS5 and when I have a indd file open, none of my coworkers are able to open the file except for a copy. I understand that really working together on the same file is something you could do. But can’t be like in MS-Office? The moment you open a indd file which is already opened by a other user, you will get a message and you can then either to open as read only or a notification when the other user is ready editing the file
    Is this possible? Or do we need some additional tools?

    But can’t be like in MS-Office? The moment you open a indd file which is already opened by a other user, you will get a message and you can then either to open as read only or a notification when the other user is ready editing the file Is this possible? Or do we need some additional tools?
    I would actually be surprised if there are no workflow management plugins that do this.
    As you imply, it's really not that hard to do.
    Making it look really slick would probably require a plugin.
    But you could do it fairly easily with some simple scripting, a few hours of work.
    One script that runs whenever anyone opens or closes a file and registers that open/closure with a server.
    Plus some extra stuff to deal with messaging.

  • How to check-in multiple files with same name having different revision num

    Hi
    Can anyone please tell me, how to check-in multiple files with the same name with different revision number using RIDC API.
    For eg:
    First I will check-in a file(TestFile.txt) into a content server with revision number 1 using RIDC API in ADF application. Then after some time, will modify the same file(TestFile.txt) and check-in again. I tried to check-in same file multiple times, however first time its checking-in correctly into server showing revision as 1, while checking-in same file again, its not giving any errror message, and also its not reflecting in server. Only one file(TestFile.txt) is reflecting in server.
    How to implement this functinality using RIDC API? Any suggestions would be helpful.
    Regards
    Raj
    Edited by: 887680 on Mar 6, 2013 10:48 AM

    Hi Srinath
    Thanks for your response. Its not cloning, its like check-in file first, then check-out the file and do some editing and then again upload the same file with different revision number using RIDC. I got the solution now.
    Regards
    Raj

  • Deploying EJBs with same name in different application jars on JBOSS

    Hi,
    We are attempting to deploy entity beans with the same name in 2 different EJB application jars on jboss 3.2.5. One bean is an extension of the other, so some of the DB columns they refer to are the same (they access different DB tables in different tablespaces). However, the field names corresponding to these DB columns in the beans themselves are different (i.e. DB column serviceid is associated with the field serviceid in one bean and service_id in the other).
    We have altered jboss.xml for one of the EJB applications so that the jndi-name used to access that application's bean is different to the jndi-name used to access the entity bean in the other EJB jar.
    However, when we attempt to deploy both jar files on the same jboss server, one of the applications deploys successfully and when we deploy the other, we get EJB spec violation errors, such as the following:
    14:18:34,631 WARN [verifier] EJB spec violation:
    Bean : CommunityAddress
    Section: 10.6.2
    Warning: The entity bean class must define a get accessor for each CMP field.
    Info : Field: service_id
    I'm presuming that this is because the bean which references the serviceid DB column with a field called serviceid is being mixed up with the other bean, which has a service_id field.
    Can anyone tell me if there is anything else that is required to get entity beans/EJBs in different applications but with the same names (and some overlapping fields, etc) deployed successfully on the same jboss server apart from editing jboss.xml for one of the applications?
    Is this a jbosscmp-jdbc.xml issue?
    Any help much appreciated,
    Maurice

    Hi Srinath
    Thanks for your response. Its not cloning, its like check-in file first, then check-out the file and do some editing and then again upload the same file with different revision number using RIDC. I got the solution now.
    Regards
    Raj

  • Problem with SQL*Loader and different date formats in the same file

    DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    System: AIX 5.3.0.0
    Hello,
    I'm using SQL*Loader to import semi-colon separated values into a table. The files are delivered to us by a data provider who concatenates data from different sources and this results in us having different date formats within the same file. For example:
    ...;2010-12-31;22/11/1932;...
    I load this data using the following lines in the control file:
    EXECUTIONDATE1     TIMESTAMP     NULLIF EXECUTIONDATE1=BLANKS     "TO_DATE(:EXECUTIONDATE1, 'YYYY-MM-DD')",
    DELDOB          TIMESTAMP     NULLIF DELDOB=BLANKS          "TO_DATE(:DELDOB, 'DD/MM/YYYY')",
    The relevant NLS parameters:
    NLS_LANGUAGE=FRENCH
    NLS_DATE_FORMAT=DD/MM/RR
    NLS_DATE_LANGUAGE=FRENCH
    If I load this file as is the values loaded into the table are 31 dec 2010 and 22 nov *2032*, aven though the years are on 4 digits. If I change the NLS_DATE_FORMAT to DD/MM/YYYY then the second date value will be loaded correctly, but the first value will be loaded as 31 dec *2020* !!
    How can I get both date values to load correctly?
    Thanks!
    Sylvain

    This is very strange, after running a few tests I realized that if the year is 19XX then it will get loaded as 2019, and if it is 20XX then it will be 2020. I'm guessing it may have something to do with certain env variables that aren't set up properly because I'm fairly sure my SQL*Loader control file is correct... I'll run more tests :-(

Maybe you are looking for

  • C3-Move the SMS to different folder

    Hi, I can see the option of Archive the SMS which will transfer the SMS in the Archive folder. Is there any way, I can move the SMS from Inbox to folder other than Archive? Thanks.

  • ALV report - copy layout to another user

    Hello, I have a question about ALV reports. In ALV we have option to select layout and save it by user-specific. How to copy this layout to another user? Is there some function/Bapi? Thanks in advance, Michal

  • Job option in the Enterprise Manager Console

    Hello, I had just installed an 9.2.0.1 oracle db. In my Enterprise Manager Console, i don't see the job and event option like the documentation shows it. Can anybody tells me how to have these options in my Console ? Thank's in advance

  • I am disabled and need help with one to one service that I paid for

    Hi there,     I brought my computer last year in Aug.  I signed up for the one year of one -to - one service.  Here is the issue, I'm disabled, and things didn't go according to plan.  I am housebound.  If I get out once a week, that's pretty much it

  • Master with more than one Detail

    Hallo, Does anybody know how to create master with more than one detail. i.e Employee as a master with the following details (Dependent, Education, Contract, Job History). thanks.. Ribhi