{"id":661,"date":"2010-06-19T22:12:29","date_gmt":"2010-06-20T04:12:29","guid":{"rendered":"http:\/\/edsionte.com\/techblog\/?p=661"},"modified":"2010-07-03T09:56:54","modified_gmt":"2010-07-03T15:56:54","slug":"%e5%ae%9e%e7%8e%b0%e8%87%aa%e5%b7%b1%e7%9a%84ls%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"http:\/\/edsionte.com\/techblog\/archives\/661","title":{"rendered":"\u5b9e\u73b0\u81ea\u5df1\u7684ls\u547d\u4ee4\uff08\u4e0a\uff09"},"content":{"rendered":"<p>\u5982\u679c\u4f60\u8ddf\u6211\u4e00\u6837\u662flinux\u4e0bC\u7f16\u7a0b\u7684\u521d\u5b66\u8005\uff0c\u90a3\u4e48\u52a8\u624b\u5b9e\u73b0\u4e00\u4e9blinux\u547d\u4ee4\u662f\u5341\u5206\u6709\u5fc5\u8981\u7684\u3002\u672c\u6587\u4e3a\u4f60\u6240\u63cf\u8ff0\u7684\u662f\u5e38\u7528ls\u547d\u4ee4\u3002ls\u547d\u4ee4\u6709\u4f17\u591a\u9009\u9879\uff0c\u672c\u6587\u4e2d\u6240\u63cf\u8ff0\u7684my_ls.c\u7a0b\u5e8f\u4ec5\u5b9e\u73b0\u4e86\uff0dl\u548c\uff0da\u9009\u9879\u3002<\/p>\n<p>ls\u547d\u4ee4\u52a0\u5165\uff0dl\u9009\u9879\u53ef\u4ee5\u4f7f\u6bcf\u4e2a\u6587\u4ef6\u5355\u72ec\u6210\u4e00\u884c\uff0c\u5e76\u4e14\u663e\u793a\u6587\u4ef6\u7684\u5c5e\u6027\u3002\u6bd4\u5982\uff1a<\/p>\n<pre class=\"brush:\">edsionte@edsionte-laptop:~\/code$ ls -l\r\n\u603b\u7528\u91cf 232\r\n-rwxr-xr-x 1 edsionte edsionte  9530 2010-06-18 11:26 error\r\n-rw-r--r-- 1 edsionte edsionte   756 2010-06-19 14:39 error.c\r\n-rw-r--r-- 1 edsionte edsionte   755 2010-06-18 11:32 error.c~\r\n-rw------- 1 edsionte edsionte     0 2010-06-16 12:40 example_62.c<\/pre>\n<p>ls\u547d\u4ee4\u52a0\u5165\uff0da\u9009\u9879\u53ef\u4ee5\u663e\u793a\u9690\u85cf\u6587\u4ef6\u3002linux\u4e2d\u9690\u85cf\u6587\u4ef6\u662f\u4ee5 . \u5f00\u5934\u7684\u3002\u6bd4\u5982\uff1a<\/p>\n<pre class=\"brush:\">edsionte@edsionte-laptop:~\/code$ ls -a\r\n.             example_65.c    my_cdvc       my_mv\r\n..            example_68_1.c  my_cdvc.c     my_mv.c<\/pre>\n<p>.\u8868\u793a\u5f53\u524d\u76ee\u5f55\uff0c..\u8868\u793a\u5f53\u524d\u76ee\u5f55\u7684\u7236\u76ee\u5f55\u3002<\/p>\n<p>\u5f53\u7136\u8fd9\u4e24\u4e2a\u9009\u9879\u53ef\u4ee5\u540c\u65f6\u4f7f\u7528\uff0c\u6bd4\u5982\uff1a<\/p>\n<pre class=\"brush:\">edsionte@edsionte-laptop:~\/code$ ls -al\r\n\u603b\u7528\u91cf 240\r\ndrwxr-xr-x  3 edsionte edsionte  4096 2010-06-20 12:10 .\r\ndrwxr-xr-x 46 edsionte edsionte  4096 2010-06-20 12:10 ..\r\n-rwxr-xr-x  1 edsionte edsionte  9530 2010-06-18 11:26 error\r\n-rw-r--r--  1 edsionte edsionte   756 2010-06-19 14:39 error.c\r\n-rw-r--r--  1 edsionte edsionte   755 2010-06-18 11:32 error.c~\r\n-rw-------  1 edsionte edsionte     0 2010-06-16 12:40 example_62.c\r\nedsionte@edsionte-laptop:~\/code$ ls -l -a\r\n\u603b\u7528\u91cf 240\r\ndrwxr-xr-x  3 edsionte edsionte  4096 2010-06-20 12:10 .\r\ndrwxr-xr-x 46 edsionte edsionte  4096 2010-06-20 12:10 ..\r\n-rwxr-xr-x  1 edsionte edsionte  9530 2010-06-18 11:26 error\r\n-rw-r--r--  1 edsionte edsionte   756 2010-06-19 14:39 error.c<\/pre>\n<p>\u672c\u6587\u6240\u8ff0\u7684my_ls.c\u7a0b\u5e8f\u5c31\u8981\u5b9e\u73b0\u8fd9\u79cd\u529f\u80fd\u3002\u5728\u4e86\u89e3\u672c\u7a0b\u5e8f\u4e2d\u6240\u6709\u51fd\u6570\u4e4b\u524d\uff0c\u8bf7\u5148\u770b\u4e00\u4e0b\u672c\u7a0b\u5e8f\u7684\u6d41\u7a0b\u56fe\uff1a\u70b9<a href=\"http:\/\/docs.google.com\/Doc?docid=0AbjQV8gpjYK_ZG03ampiMl8xNWJoa2Y1Y24&amp;hl=en\" target=\"_blank\">\u8fd9\u91cc<\/a>\uff08\u672cblog\u4e0a\u4f20\u56fe\u7247\u6709\u70b9\u95ee\u9898\uff0c\u6b63\u5728\u89e3\u51b3\u4e2d\u2026\u2026\uff09\u3002<\/p>\n<p>\u73b0\u5728\u5bf9\u672c\u7a0b\u5e8f\u4e2d\u7684\u5404\u4e2a\u51fd\u6570\u505a\u4ee5\u5927\u81f4\u8bf4\u660e\u3002<\/p>\n<p>(1)void my_err(const char*,int,int);\u548cvoid my_err2(const char*,int);<\/p>\n<p>\u9519\u8bef\u6355\u83b7\u51fd\u6570\u3002\u8be6\u7ec6\u5b9e\u73b0\u8fc7\u7a0b\u8bf7\u70b9<a href=\"http:\/\/edsionte.com\/techblog\/?p=638\" target=\"_blank\">\u8fd9\u91cc<\/a>\u3002<\/p>\n<p>(2)void display_dir(int flag_param,char*path);<\/p>\n<p>\u5982\u679c\u547d\u4ee4\u4e2d\u542b\u6709\u76ee\u5f55\uff0c\u5219\u8fdb\u5165\u6b64\u51fd\u6570\u3002\u6b64\u51fd\u6570\u5c06\u83b7\u53d6path\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u603b\u6570\u4ee5\u53ca\u6240\u6709\u6587\u4ef6\u540d\uff08\u5305\u62ec\u9690\u85cf\u6587\u4ef6\uff09\u3002\u6d41\u7a0b\u56fe\u70b9<a href=\"http:\/\/docs.google.com\/Doc?docid=0AbjQV8gpjYK_ZG03ampiMl8yZ2h2eHIyZzg&amp;hl=en\" target=\"_blank\">\u8fd9\u91cc<\/a>\u3002<\/p>\n<p>(3)void display(int flag,char*pathname);<\/p>\n<p>pathname\u662f\u4e00\u4e2a\u6587\u4ef6\u7684\u5b8c\u6574\u8def\u5f84\u540d\uff0c\u672c\u51fd\u6570\u9996\u5148\u4ece\u5b8c\u6574\u7684\u8def\u5f84\u540d\u4e2d\u89e3\u6790\u51fa\u6587\u4ef6\u540d\uff0c\u518d\u6839\u636eflag\u8fdb\u5165\u4e0d\u540c\u7684\u51fd\u6570\u3002\u6d41\u7a0b\u56fe\u70b9<a href=\"http:\/\/docs.google.com\/Doc?docid=0AbjQV8gpjYK_ZG03ampiMl8zYzV4azVuZnQ&amp;hl=en\" target=\"_blank\">\u8fd9\u91cc<\/a>\u3002<\/p>\n<p>(4)void display_single(char*);<\/p>\n<p>\u5982\u679c\u53c2\u6570\u4e2d\u4e0d\u542b\u4efb\u4f55\u9009\u9879\u6216\u8005\u4ec5\u542b\uff0da\uff0c\u5219\u8fdb\u5165\u6b64\u51fd\u6570\u3002\u672c\u51fd\u6570\u76f4\u63a5\u663e\u793a\u51fa\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u540d\uff0c\u5e76\u4e14\u5b9e\u73b0\u6587\u4ef6\u540d\u5de6\u5bf9\u9f50\u3002<\/p>\n<p>(5)void display_attribute(struct stat,char*);<\/p>\n<p>\u5982\u679c\u547d\u4ee4\u4e2d\u542b\u6709\uff0dl\u5219\u8fdb\u5165\u672c\u51fd\u6570\uff0c\u663e\u793a\u51fa\u6587\u4ef6\u7684\u5404\u79cd\u5c5e\u6027\u3002<\/p>\n<p>\u5728\u672c\u6587\u7684\u4e0a\u73ed\u90e8\u5206\u4e2d\u4e3b\u8981\u4e3a\u60a8\u7406\u6e05\u672c\u7a0b\u5e8f\u7684\u5927\u4f53\u7ed3\u6784\uff0c\u5728\u4e0b\u534a\u90e8\u5206\u4e2d\u5c06\u8be6\u7ec6\u5206\u6790\u6e90\u4ee3\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u4f60\u8ddf\u6211\u4e00\u6837\u662flinux\u4e0bC\u7f16\u7a0b\u7684\u521d\u5b66\u8005\uff0c\u90a3\u4e48\u52a8\u624b\u5b9e\u73b0\u4e00\u4e9blinux\u547d\u4ee4\u662f\u5341\u5206\u6709\u5fc5\u8981\u7684\u3002\u672c\u6587\u4e3a\u4f60\u6240\u63cf\u8ff0\u7684\u662f\u5e38 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[109,108,107],"class_list":["post-661","post","type-post","status-publish","format-standard","hentry","category-linuxc","tag-c","tag-linux","tag-107"],"views":6199,"_links":{"self":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/comments?post=661"}],"version-history":[{"count":0,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/661\/revisions"}],"wp:attachment":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/media?parent=661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/categories?post=661"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/tags?post=661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}