- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: calculatinf file size during FTP from windows ...
Operating System - HP-UX
1823058
Members
3137
Online
109645
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2009 09:57 AM
тАО09-30-2009 09:57 AM
calculatinf file size during FTP from windows to unix server
Hi,
can Anyone tell me what is the syntax to get the size of the file before and after FTP.
I am FTPing from windox box to unix box....
can Anyone tell me what is the syntax to get the size of the file before and after FTP.
I am FTPing from windox box to unix box....
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2009 12:48 PM
тАО09-30-2009 12:48 PM
Re: calculatinf file size during FTP from windows to unix server
Hello Jag14!
You can use "ls -l" or "dir" on Windows clients to see size file in bytes. You could also use the "raw" command to send this request for a given file:
quote size file_name
It will return 2 numbers, the first is the ftp reply code, the second the size in bytes.
After you downloaded the file use "ls -l file_name" or "du -ks file_name" to see the size of the file.
Kind regards,
Kobylka
You can use "ls -l" or "dir" on Windows clients to see size file in bytes. You could also use the "raw" command to send this request for a given file:
quote size file_name
It will return 2 numbers, the first is the ftp reply code, the second the size in bytes.
After you downloaded the file use "ls -l file_name" or "du -ks file_name" to see the size of the file.
Kind regards,
Kobylka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2009 01:05 PM
тАО09-30-2009 01:05 PM
Re: calculatinf file size during FTP from windows to unix server
As this is a HP-UX group, I assume you're using a HP-UX FTP client to get files from Windows FTP server.
Use the "dir" command in the FTP client to see the remote directory listing in a form that usually includes the file size.
Or use the "size" FTP command: the response should be the result code 213 and the size of the remote file, like this:
213
To see the size of a local file, use the normal command-line "ls -l" or "ll" commands, but prefix them with an exclamation sign:
!ls -l
If you're running a command-line based FTP client on a Windows host, accessing a HP-UX server, there are a few differences:
1.) use the "!dir" to see the size of a local file, as "ls" is not a valid command for the Windows command prompt.
2.) the Windows command-line FTP client may not understand the "size" command. Fortunately the command is so simple you don't need the FTP client to interpret its output. You can use "quote size" to send the command directly to the server, bypassing any client-side validity checks.
If you transfer files in binary mode, the file size (and the file content) should not change at all.
If you transfer text files in ASCII mode, find out the number of lines in the file ("wc -l" in Unix).
The ASCII mode translates one-byte Unix line terminators to two-byte Windows line terminators or vice versa. So the text file should grow in size by one byte per line when transferred from Unix to Windows, or shrink the same amount if transferred from Windows to Unix.
If you transfer a file that contains any non-ASCII characters using the ASCII mode of FTP, the file will most likely be corrupted in transit. Don't do it. Use the binary mode instead, and use a proper tool for character set conversion.
MK
Use the "dir" command in the FTP client to see the remote directory listing in a form that usually includes the file size.
Or use the "size
213
To see the size of a local file, use the normal command-line "ls -l" or "ll" commands, but prefix them with an exclamation sign:
!ls -l
If you're running a command-line based FTP client on a Windows host, accessing a HP-UX server, there are a few differences:
1.) use the "!dir
2.) the Windows command-line FTP client may not understand the "size" command. Fortunately the command is so simple you don't need the FTP client to interpret its output. You can use "quote size
If you transfer files in binary mode, the file size (and the file content) should not change at all.
If you transfer text files in ASCII mode, find out the number of lines in the file ("wc -l
The ASCII mode translates one-byte Unix line terminators to two-byte Windows line terminators or vice versa. So the text file should grow in size by one byte per line when transferred from Unix to Windows, or shrink the same amount if transferred from Windows to Unix.
If you transfer a file that contains any non-ASCII characters using the ASCII mode of FTP, the file will most likely be corrupted in transit. Don't do it. Use the binary mode instead, and use a proper tool for character set conversion.
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2009 01:11 PM
тАО09-30-2009 01:11 PM
Re: calculatinf file size during FTP from windows to unix server
a problem will arise if the files are plain-text and transferred in ascii mode. fpt should convert the unix end-of-line to windows end-of-line, one is CR, the other is CR/LF. I believe windows is the later. In either case, the size or the transferred file will differ by one byte per line of text in the original.
I assume you're looking at this to check the validity of the file once transferred? If that's the case, it won't work, at least for text files. Neither will checksumming, for similar reasons.
If you need to be 100% sure the file made it, and isn't damaged or corrupted in some fashion, you may need to look at something other that FTP as the transfer mechanism.
I assume you're looking at this to check the validity of the file once transferred? If that's the case, it won't work, at least for text files. Neither will checksumming, for similar reasons.
If you need to be 100% sure the file made it, and isn't damaged or corrupted in some fashion, you may need to look at something other that FTP as the transfer mechanism.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP