![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| unix file size becomes zero | ananthmm | Filesystems, Disks and Memory | 1 | 10-01-2006 08:12 AM |
| how to find the file size in unix | lmraochodisetti | UNIX for Advanced & Expert Users | 4 | 07-24-2006 04:20 AM |
| checking the size of unix cd on windows platform | johnjsm | Windows & DOS: Issues & Discussions | 2 | 12-09-2004 01:49 AM |
| Unix file size - HP-UX | krishna7 | HP-UX | 2 | 07-18-2003 08:58 AM |
| Hp Unix file size problem | A Roberts | UNIX for Dummies Questions & Answers | 3 | 11-29-2001 04:50 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
file size different in unix and windows
I have a file on solaris/linux.
ls -ls shows the logical size to be: 13292 However, when I transfer the file to my windows machine.. Rightclick->Properties shows the file size as: 13421 I wrote a small program on unix and windows that does a stat() on the file and reports the st_size (file size in bytes) and I get the same result (13292 on windows and 13421 on unix) Interestingly, this happens only with .txt files. For .pdf and .ppt files, the file size is the same. However, for .txt files the file size on windows is > that on unix. For another txt file (17MB) Windows: 18701307 bytes Unix: 18581191 Does anybody know why is this happening ? Thanks ! |
| Forum Sponsor | ||
|
|
|
|||
|
Unix text file end each line with a line feed character.
DOS/Windows text files end each line with a carriage return and line feed. Because of this, there is one additional character in a DOS/Windows file for each line in the file. Your file contains 13421 - 13292 = 129 lines. When you transfer the file from Unix to DOS using ascii mode in ftp, this conversion takes place automatically. If you use binary mode, no conversion takes place. |
| Tags |
| linux, regex, regular expressions |
| Thread Tools | |
| Display Modes | |
|
|