Byte count difference between Unix and Windows

Hi,
I use sun.net.ftp.FtpClient to transfer files from a windows machine to a unix server.
The transfer works fine.
However, due to a problem I had a few days ago with the file not completing it's transfer but no side (not my FtpClient object nor the UNIX Ftp server) has thrown an exception or reported an error, I need to verify the transfer is complete.
from the byte count I see that on my machine, the file size is 120743 bytes, and on the server side it's 121047 bytes.
The file has 14172 records, when the last one is an empty line.
There is a 304 bytes difference between the 2 reports.
I downloaded the file I transferred there manually and compared the 2 and they match.
How can I know from my program if the transfer is complete?
Thanks,
Omer.

The file size isn't 304 byte, that's the difference between the 2 files.
I use FtpClient.binary() to set the mode to binary prior to sending the file.
The file has 14172 records which should add up to a total difference of 14172 bytes (maybe 1 or 2 more if there is a difference in the EOF), but not 304.
here's the code:
putClient=new FtpClient(host, port); //initialize the client object
putClient.login(user, password);
putClient.binary(); //set transfer mode to binary
putClient.cd(remotePath); //change directory to the target one
FileInputStream fileIn=new FileInputStream(sourcePath + File.separator + sourceFileName);
long fileSize=fileIn.getChannel().size(); //get the size of the file
TelnetOutputStream telnetOut=putClient.put(remoteFileName);//acquire an input stream from the server
byte[] byteBuff=new byte[8192]; //8 kb buffer
int readSuccesfull=0;
while((readSuccesfull=fileIn.read(byteBuff))!=-1){ // now transfer the file
telnetOut.write(byteBuff, 0, readSuccesfull);
totalByetsSent+=readSuccesfull;
fileIn.close();//release the file stream resource
TelnetInputStream inStream = putClient.list(); // acquire a stream for verifying the file was received
/* now I read the lines of the list() command and parse the lines for the size and date and I get that the file that I sent has a size of 121047, and the line that represents it is this:
-rwxrwxrwx   1 owner    group          121047 Jan 10 17:49 ivory.txt
However, the size from my machine's report is 120743 which I get from the fileSize variable*/According to what has been said here, and to my intuition, the size on UNIX should be smaller than the size on Windows, but yet, it's not the case.
This would add up fine if the file that I downloaded from the server wouldn't match the file that I sent, but they do.
I'm pretty much a noob at developing and even more a noob at Java, so there is a very good chance that I do something wrong here, could be with the use of the FileChannel.size() method usage.
Thanks.

Similar Messages

  • Difference between view and window ?

    Hi All,
    Can you tell me a basic difference between view and window , maybe you can correlate your answers with concepts of HTML.
    Rajeev

    Hi Rajeev,
    A window is a place for displaying your views. Your view is not available to the outside world. View is available only to your component. However, your window is an interface view, which can be displayed in other components.
    A view contains your UI elements. It has a layout (a window does not). A window contains embedded views.
    In the window, you can define how navigation between views takes place (by creating navigation links).
    Regards,
    Neha
    <i><b>PS: Reward if helpful</b></i>

  • Differences between AIX and Windows for SAP

    Dear All,
    I have a problem regarding SAP Software.We want to change our company software .First we order SAP On Windows with Oracle10g But Now We want SAP on AIX with Oracle10g.
    SAP delivered us software on Windows platform.
    Please Suggest me for this as what are the differences between the above two platforms and what are the differences between the above 2 platforms.
    Regards,
    Pankaj Kalsayan

    hi Pankaj,
    well, this is a very general question. perhaps you could specify a little more.
    in general i would see no difference regarding the end user sitting in front of his pc using sapgui.
    as far as i know all server side sap software is available for aix and windows (and many more).
    for administration on the other hand there is of course lots of difference. AIX is a UNIX operating system running on special hardware with power processors. it offers quit extensive virtualisation abilities using so called LPARs and supports real big number of CPUs and large RAM. Windows is a completly differnet operating system running mostly on x86/amd64 hardware.
    therefore you should also consider what know-how is available in your system administration.
    not shure if that is partly answering your question ...
    btw. if you are going forward with AIX you should perhaps consider switching oracle with db2. so you have a consistent IBM based landscape. also to me, sap and db2 seem to "like" each other more than sap and oracle
    regards,
    martin

  • Timing difference between Macbook and WIndows system

    I uses a web content management system for my website which was developed in windows, IE and firefox compatible. I notice that if I open up the website in a Macbook Pro, the system time is always 8 hours ahead of Singapore time although the Macbook time settings is set locally. I use firefox, safari, IE5, same result. Which means whatever contents I saved only appears 8 hours later. I use Windows IE or firefox and it works just fine. I don't think is the CMS system problem. I thought it might just be on this Macbook, I got someone to try it out using another Macbook, same result, 8 hours ahead. So it it something about the Macbook settings?
    na   Windows XP Pro  

    Hi Keonigt,
    There are definitely hardware differences between the MacBook and its bigger sibling the MacBook Pro. You pointed out the first difference of screen sizes. Another perhaps obvious difference is the MacBook Pro's external construction is aluminum as opposed to "plastic". Another difference which may affect performance is that the MacBook Pro utilizes dedicated Video RAM as opposed to the MacBook's sharing it's VRAM with its RAM. This will affect gaming and other graphic intensive applications.
    Depending on your needs and objectives - these differences will affect your decision. Of course, both are fantastic machines.
    Good luck.

  • Differences Between Mac and Windows Versions (cP6)

    I am curious if there is any known differences between the Mac and Windows versions of Captivate 6?
    Thank you.

    No big differences

  • LabVIEW 8.5.1 Student edition - differences between Mac and Windows version?

    Hi,
    I've just bought the student version of LabVIEW 8.5.1 and am using Mac OS X 10.4.11. What are the biggest differences between the Mac and Windows versions since the box came with a Mac installer CD and a Windows installer DVD?
    Cheers 
    Solved!
    Go to Solution.

    Looks like you got the LabVIEW Student Edition Software Suite DVD.
    It comes with 6 toolkits, and from the product spects, some (or all?) of those are windows only (at least in 8.5), e.g.:
    Digital Filter Design Toolkit
    Modulation Toolkit
    SignalExpress
    Since you have 8.5, you are also missing a few basic things that only recevied MAC support in 8.6, such as Mathscript, Control design and Simulation, and Native 3D graphs.
    LabVIEW Champion . Do more with less code and in less time .

  • Difference between Mac and Windows Format

    Is there any differences between the two. I have a nano that is windows formatted, but it also works on my mac. Does it really matter which OS you use to format it?

    well yes a mac formatted iPod will not work on a PC

  • Pros and Cons Between UNIX and Windows Servers

    Hi,
    Currently the business I work for runs SAP on UNIX, but there is talk of moving to Windows servers as there are more skills available in SQL.
    It is our belief however, that UNIX servers are more 'stable' than Windows. We believe it would cost more in staff time if there was a transfer to Windows because of more system downtime, due to a larger amount of server updates.
    I would like to know the experiences and opinions of' anyone who has made the switch from UNIX to Windows, or vice versa.
    Has anyone considered moving to Windows and decided against it? What were the pros and cons?
    II'm sure this is an issue that has been considered by many experts. I look forward to reading your responses.
    Regards,
    Luke

    Thanks Michael, that thread is really useful and gives me some good information for my report.
    I'm still interested in hearing more opinions on this. Is there anyone that has successfully fought off a proposed change to Windows from UNIX based on pros and cons, or vice versa? I want to hear both sides of the argument and have a really interesting, opinionated discussion in this thread.
    Regards,
    Luke
    Edited by: Luke Mercer on Apr 22, 2010 6:02 PM

  • CS5 differences between mac and windows

    Hello all, we just installed CS5 on a new PC and are now comtemplating purchasing a MAC to run CS5 on as well.  I was wondering what the differences are and limitations now that they're both on Intel processors.
    Our designers are concerned that with out a MAC they won't be able to "if we get any native mac files, we won’t be able to access them—it does happen sometimes"
    They mention that some portions of one of our publications are done completely on a MAC.
    Any input or justification would be appreciated!

    There are no differences to speak of between the applications on the two platforms. The only possible issue would be fonts. Mac Type 1 fonts are not compatible with Windows but almost everything is OpenType today and that's totally crossplatform.
    Bob

  • Difference between mac and windows

    I'm a beginner user of Adobe Presenter in Japan.
    I don't know why the price of this app differs between for Windows($499.00) and for Mac(Video Express:$1.99).
    Although I tried using both version(Win and Mac), I confermed no differences in functions, abilities, and so on.
    Please tell me the reason why. i think it's unfair.

    Hello,
    Welcome to Adobe Forums.
    Adobe Presenter 9 for windows works as a plugin in MS Powerpoint (2007, 2010 & 2013 [32bit])
    You can add quizzes, create videos, publish SCORM content and you can convert your Powerpoint Presentation into interactive content.
    Adobe Presenter Video Express for MAC is an app which is used for create vidoes and publish them as MP4
    Thanks,
    Vikram
    Adobe Support

  • Essbase system 9 -difference between the installation in UNIX and windows

    Hi,
    plz let me know the difference in installation in UNIX and windows, let me know the process. this is bit ugent...
    advanced thanks for your help and support.
    Thanks,
    sudhakar

    Hi Sudhakar,
    You have 2 documents for windows_installation and unix_installatio in the following location.
    http://download.oracle.com/docs/cd/E10530_01/doc/nav/portal_1.htm
    Sandeep Reddy Enti
    HCC
    http://analytiks.blogspot.com

  • DIFFERENCE BETWEEN SUM AND COUNT IN SQL

    DIFFERENCE BETWEEN SUM AND COUNT IN SQL
    WHAT IS THE DIFFERENCE VERIFY IN DETAIL/

    21031980, I suggest you upgrade your computer sothat you can access google.
    lol.
    wtfpwnd.Google is also helpful for understanding the strange
    acronyms that show up around here lately (yes, I did
    find and understand this one). :-)Haha, sorry!
    It's the inner-gamer in me rearing its ugly head...
    :-)

  • Difference between int and byte

    what is the main difference between int and byte?

    A byte is the format data is stored in memory in past. 8 bits.
    An int is a format likewise you get it as value from the accumulator. For X64 that is Int64.
    For compatibility the "Integer" is kept currently on Int32, the register format from the X86 computers. 
    Older computers likewise the 8088 had an 8 bit Int and therefore that was the same as the byte.
    The 80286 had a 16 bits Integer.
    Success
    Cor

  • What are the Basic Differences between Oracle and  MS-SQL server Database?

    Hello,
            anybody pls Guide me about the Differences between Oracle and MS-SQL server Database.and also IBM Databases also
    Regards,
    Balaram

    SQL Server only works on Windows-based platforms, including Windows 9x, Windows NT, Windows 2000 and Windows CE.
    In comparison with SQL Server , OracleDatabase supports all known platforms, including Windows-based platforms, AIX-Based Systems, Compaq Tru64 UNIX, HP 9000 Series HP-UX, Linux Intel, Sun Solaris and so on.
    The SQL Server  advantages:
    SQL Server  holds the top TPC-C performance and price/performance results.
    SQL Server  is generally accepted as easier to install, use and manage.
    The Oracle  Database advantages:
    Oracle  Database supports all known platforms, not only the Windows-based platforms.
    PL/SQL is more powerful language than T-SQL.
    More fine-tuning to the configuration can be done via start-up parameters.
    Samrat

  • What is the difference between tkprof and explainplan

    Hi,
    what is the difference between tkprof and explainplan.

    Execution Plans and the EXPLAIN PLAN Statement
    Before the database server can execute a SQL statement, Oracle must first parse the statement and develop an execution plan. The execution plan is a task list of sorts that decomposes a potentially complex SQL operation into a series of basic data access operations. For example, a query against the dept table might have an execution plan that consists of an index lookup on the deptno index, followed by a table access by ROWID.
    The EXPLAIN PLAN statement allows you to submit a SQL statement to Oracle and have the database prepare the execution plan for the statement without actually executing it. The execution plan is made available to you in the form of rows inserted into a special table called a plan table. You may query the rows in the plan table using ordinary SELECT statements in order to see the steps of the execution plan for the statement you explained. You may keep multiple execution plans in the plan table by assigning each a unique statement_id. Or you may choose to delete the rows from the plan table after you are finished looking at the execution plan. You can also roll back an EXPLAIN PLAN statement in order to remove the execution plan from the plan table.
    The EXPLAIN PLAN statement runs very quickly, even if the statement being explained is a query that might run for hours. This is because the statement is simply parsed and its execution plan saved into the plan table. The actual statement is never executed by EXPLAIN PLAN. Along these same lines, if the statement being explained includes bind variables, the variables never need to actually be bound. The values that would be bound are not relevant since the statement is not actually executed.
    You don’t need any special system privileges in order to use the EXPLAIN PLAN statement. However, you do need to have INSERT privileges on the plan table, and you must have sufficient privileges to execute the statement you are trying to explain. The one difference is that in order to explain a statement that involves views, you must have privileges on all of the tables that make up the view. If you don’t, you’ll get an “ORA-01039: insufficient privileges on underlying objects of the view” error.
    The columns that make up the plan table are as follows:
    Name Null? Type
    STATEMENT_ID VARCHAR2(30)
    TIMESTAMP DATE
    REMARKS VARCHAR2(80)
    OPERATION VARCHAR2(30)
    OPTIONS VARCHAR2(30)
    OBJECT_NODE VARCHAR2(128)
    OBJECT_OWNER VARCHAR2(30)
    OBJECT_NAME VARCHAR2(30)
    OBJECT_INSTANCE NUMBER(38)
    OBJECT_TYPE VARCHAR2(30)
    OPTIMIZER VARCHAR2(255)
    SEARCH_COLUMNS NUMBER
    ID NUMBER(38)
    PARENT_ID NUMBER(38)
    POSITION NUMBER(38)
    COST NUMBER(38)
    CARDINALITY NUMBER(38)
    BYTES NUMBER(38)
    OTHER_TAG VARCHAR2(255)
    PARTITION_START VARCHAR2(255)
    PARTITION_STOP VARCHAR2(255)
    PARTITION_ID NUMBER(38)
    OTHER LONG
    DISTRIBUTION VARCHAR2(30)
    There are other ways to view execution plans besides issuing the EXPLAIN PLAN statement and querying the plan table. SQL*Plus can automatically display an execution plan after each statement is executed. Also, there are many GUI tools available that allow you to click on a SQL statement in the shared pool and view its execution plan. In addition, TKPROF can optionally include execution plans in its reports as well.
    Trace Files and the TKPROF Utility
    TKPROF is a utility that you invoke at the operating system level in order to analyze SQL trace files and generate reports that present the trace information in a readable form. Although the details of how you invoke TKPROF vary from one platform to the next, Oracle Corporation provides TKPROF with all releases of the database and the basic functionality is the same on all platforms.
    The term trace file may be a bit confusing. More recent releases of the database offer a product called Oracle Trace Collection Services. Also, Net8 is capable of generating trace files. SQL trace files are entirely different. SQL trace is a facility that you enable or disable for individual database sessions or for the entire instance as a whole. When SQL trace is enabled for a database session, the Oracle server process handling that session writes detailed information about all database calls and operations to a trace file. Special database events may be set in order to cause Oracle to write even more specific information—such as the values of bind variables—into the trace file.
    SQL trace files are text files that, strictly speaking, are human readable. However, they are extremely verbose, repetitive, and cryptic. For example, if an application opens a cursor and fetches 1000 rows from the cursor one row at a time, there will be over 1000 separate entries in the trace file.
    TKPROF is a program that you invoke at the operating system command prompt in order to reformat the trace file into a format that is much easier to comprehend. Each SQL statement is displayed in the report, along with counts of how many times it was parsed, executed, and fetched. CPU time, elapsed time, logical reads, physical reads, and rows processed are also reported, along with information about recursion level and misses in the library cache. TKPROF can also optionally include the execution plan for each SQL statement in the report, along with counts of how many rows were processed at each step of the execution plan.
    The SQL statements can be listed in a TKPROF report in the order of how much resource they used, if desired. Also, recursive SQL statements issued by the SYS user to manage the data dictionary can be included or excluded, and TKPROF can write SQL statements from the traced session into a spool file.
    How EXPLAIN PLAN and TKPROF Aid in the Application Tuning Process
    EXPLAIN PLAN and TKPROF are valuable tools in the tuning process. Tuning at the application level typically yields the most dramatic results, and these two tools can help with the tuning in many different ways.
    EXPLAIN PLAN and TKPROF allow you to proactively tune an application while it is in development. It is relatively easy to enable SQL trace, run an application in a test environment, run TKPROF on the trace file, and review the output to determine if application or schema changes are called for. EXPLAIN PLAN is handy for evaluating individual SQL statements.
    By reviewing execution plans, you can also validate the scalability of an application. If the database operations are dependent upon full table scans of tables that could grow quite large, then there may be scalability problems ahead. On the other hand, if large tables are accessed via selective indexes, then scalability may not be a problem.
    EXPLAIN PLAN and TKPROF may also be used in an existing production environment in order to zero in on resource intensive operations and get insights into how the code may be optimized. TKPROF can further be used to quantify the resources required by specific database operations or application functions.
    EXPLAIN PLAN is also handy for estimating resource requirements in advance. Suppose you have an ad hoc reporting request against a very large database. Running queries through EXPLAIN PLAN will let you determine in advance if the queries are feasible or if they will be resource intensive and will take unacceptably long to run.

Maybe you are looking for

  • Problem Crystal Report on SAP 8.8

    Hi all! I need to modify an addon developed for SAP2007 so that it works even on SAP 8.8. Now, i have an error when i try to show a report made with Crystal Report. I know that in SAP 8.8, Crystal Reports are seamlessly integrated in the core product

  • Meaningful Slideshow module update, please - Ken Burns effect

    Just upgraded to LR 5 from LR 3.  I'm floored that there still has never been any sort of meaningful update to the slideshow module. Assume you want to make a slideshow for a funeral.  (That's probably what most people actually do with slideshows any

  • Search Buttons

    Is it possible for me to add my own search button topics in the search tab in Soundtrack Pro 2. I know you can add your own sound effects directories by clicking the setup tab. What I am wondering is if it is possible, say I have a folder of 'swooshe

  • Check Points for Jury duty pay Configuration

    Hi Experts, Can any one explain the check points to be considered for Jury duty pay configuration. With Regards, Satish

  • Operations not permitted

    Hi I have a MacBook Pro with a corrupted copy of Snow Leopard 10.6.8 installed on the HD (I say corrupted because if I try selecting the HD as the startup disk I'm locked at the pretty spinning gear screen). The problem started when I went a little O