Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
[Question] Generate a format for FTP server
I am writing a ftp server and I have somethings to ask.
When I use my toy java ftp client connect to well know FTP server such as winftp. I can receive the following format when I send "LIST" to the server:
[code]-rw-r--r-- 1 1002 1002 21861 Apr 26 16:17 123.jpg
drwxr-xr-x 2 1002 1002 4096 Apr 14 06:07 abc
-rw-r--r-- 1 1002 1002 6 Apr 16 06:29 good.java
-rw-r--r-- 1 1002 1002 0 Apr 20 05:35 bad.java[/code]
Now, when my toy ftp server receive a "LIST" command, I need to send somethings like the above format.
I tried other format such as
But it doesn't work because this format cannot be read by the ftp client.
So, I tried to foo the ftp client. I just hard code the above strings and send to the client. The client can be fooled by me =].
My question is "In java, is there any function or class can help me to make such kind of format?". Or can anyone tell me what format will be recognized by the client? This is because such format is difficult to build such as the first column (-rw-r--r--) and I don't know what every column means.
0 · ·