亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? du.c

?? Linux.Programming.by example 的源代碼絕對經典
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* du -- summarize disk usage   Copyright (C) 1988-1991, 1995-2003 Free Software Foundation, Inc.   This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2, or (at your option)   any later version.   This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.   You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software Foundation,   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  *//* Differences from the Unix du:   * Doesn't simply ignore the names of regular files given as arguments     when -a is given.   By tege@sics.se, Torbjorn Granlund,   and djm@ai.mit.edu, David MacKenzie.   Variable blocks added by lm@sgi.com and eggert@twinsun.com.   Rewritten to use nftw by Jim Meyering.  */#include <config.h>#include <stdio.h>#include <getopt.h>#include <sys/types.h>#include <assert.h>#include "system.h"#include "dirname.h" /* for strip_trailing_slashes */#include "error.h"#include "exclude.h"#include "ftw.h"#include "hash.h"#include "human.h"#include "quote.h"#include "quotearg.h"#include "same.h"#include "xstrtol.h"/* The official name of this program (e.g., no `g' prefix).  */#define PROGRAM_NAME "du"#define AUTHORS \  N_ ("Torbjorn Granlund, David MacKenzie, Larry McVoy, Paul Eggert, and Jim Meyering")/* Initial size of the hash table.  */#define INITIAL_TABLE_SIZE 103/* The maximum number of simultaneously open file handles that   may be used by ftw.  */#define MAX_N_DESCRIPTORS (3 * UTILS_OPEN_MAX / 4)/* Hash structure for inode and device numbers.  The separate entry   structure makes it easier to rehash "in place".  */struct entry{  ino_t st_ino;  dev_t st_dev;};/* A set of dev/ino pairs.  */static Hash_table *htab;/* Name under which this program was invoked.  */char *program_name;/* If nonzero, display counts for all files, not just directories.  */static int opt_all = 0;/* If nonzero, rather than using the disk usage of each file,   use the apparent size (a la stat.st_size).  */static int apparent_size = 0;/* If nonzero, count each hard link of files with multiple links.  */static int opt_count_all = 0;/* If nonzero, print a grand total at the end.  */static int print_totals = 0;/* If nonzero, do not add sizes of subdirectories.  */static int opt_separate_dirs = 0;/* If nonzero, dereference symlinks that are command line arguments.   Implementing this while still using nftw is a little tricky.   For each command line argument that is a symlink-to-directory,   call nftw with "command_line_arg/." and remember to omit the   added `/.' when printing.  */static int opt_dereference_arguments = 0;/* Show the total for each directory (and file if --all) that is at   most MAX_DEPTH levels down from the root of the hierarchy.  The root   is at level 0, so `du --max-depth=0' is equivalent to `du -s'.  */static int max_depth = INT_MAX;/* Human-readable options for output.  */static int human_output_opts;/* The units to use when printing sizes.  */static uintmax_t output_block_size;/* File name patterns to exclude.  */static struct exclude *exclude;/* Grand total size of all args, in bytes. */static uintmax_t tot_size = 0;/* In some cases, we have to append `/.' or just `.' to an argument   (to dereference a symlink).  When we do that, we don't want to   expose this artifact when printing file/directory names, so these   variables keep track of the length of the original command line   argument and the length of the suffix we've added, respectively.   ARG_LENGTH == 0 indicates that we haven't added a suffix.   This information is used to omit any such added characters when   printing names.  */size_t arg_length;size_t suffix_length;/* Nonzero indicates that du should exit with EXIT_FAILURE upon completion.  */int G_fail;#define IS_FTW_DIR_TYPE(Type)	\  ((Type) == FTW_D		\   || (Type) == FTW_DP		\   || (Type) == FTW_DNR)/* For long options that have no equivalent short option, use a   non-character as a pseudo short option, starting with CHAR_MAX + 1.  */enum{  APPARENT_SIZE_OPTION = CHAR_MAX + 1,  EXCLUDE_OPTION,  MAX_DEPTH_OPTION};static struct option const long_options[] ={  {"all", no_argument, NULL, 'a'},  {"apparent-size", no_argument, NULL, APPARENT_SIZE_OPTION},  {"block-size", required_argument, 0, 'B'},  {"bytes", no_argument, NULL, 'b'},  {"count-links", no_argument, NULL, 'l'},  {"dereference", no_argument, NULL, 'L'},  {"dereference-args", no_argument, NULL, 'D'},  {"exclude", required_argument, 0, EXCLUDE_OPTION},  {"exclude-from", required_argument, 0, 'X'},  {"human-readable", no_argument, NULL, 'h'},  {"si", no_argument, 0, 'H'},  {"kilobytes", no_argument, NULL, 'k'}, /* long form is obsolescent */  {"max-depth", required_argument, NULL, MAX_DEPTH_OPTION},  {"megabytes", no_argument, NULL, 'm'}, /* obsolescent */  {"one-file-system", no_argument, NULL, 'x'},  {"separate-dirs", no_argument, NULL, 'S'},  {"summarize", no_argument, NULL, 's'},  {"total", no_argument, NULL, 'c'},  {GETOPT_HELP_OPTION_DECL},  {GETOPT_VERSION_OPTION_DECL},  {NULL, 0, NULL, 0}};voidusage (int status){  if (status != 0)    fprintf (stderr, _("Try `%s --help' for more information.\n"),	     program_name);  else    {      printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);      fputs (_("\Summarize disk usage of each FILE, recursively for directories.\n\\n\"), stdout);      fputs (_("\Mandatory arguments to long options are mandatory for short options too.\n\"), stdout);      fputs (_("\  -a, --all             write counts for all files, not just directories\n\      --apparent-size   print apparent sizes, rather than disk usage; although\n\                          the apparent size is usually smaller, it may be\n\                          larger due to holes in (`sparse') files, internal\n\                          fragmentation, indirect blocks, and the like\n\  -B, --block-size=SIZE use SIZE-byte blocks\n\  -b, --bytes           equivalent to `--apparent-size --block-size=1'\n\  -c, --total           produce a grand total\n\  -D, --dereference-args  dereference FILEs that are symbolic links\n\"), stdout);      fputs (_("\  -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)\n\  -H, --si              likewise, but use powers of 1000 not 1024\n\  -k                    like --block-size=1K\n\  -l, --count-links     count sizes many times if hard linked\n\"), stdout);      fputs (_("\  -L, --dereference     dereference all symbolic links\n\  -S, --separate-dirs   do not include size of subdirectories\n\  -s, --summarize       display only a total for each argument\n\"), stdout);      fputs (_("\  -x, --one-file-system  skip directories on different filesystems\n\  -X FILE, --exclude-from=FILE  Exclude files that match any pattern in FILE.\n\      --exclude=PATTERN Exclude files that match PATTERN.\n\      --max-depth=N     print the total for a directory (or file, with --all)\n\                          only if it is N or fewer levels below the command\n\                          line argument;  --max-depth=0 is the same as\n\                          --summarize\n\"), stdout);      fputs (HELP_OPTION_DESCRIPTION, stdout);      fputs (VERSION_OPTION_DESCRIPTION, stdout);      fputs (_("\n\SIZE may be (or may be an integer optionally followed by) one of following:\n\kB 1000, K 1024, MB 1,000,000, M 1,048,576, and so on for G, T, P, E, Z, Y.\n\"), stdout);      printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);    }  exit (status);}static unsigned intentry_hash (void const *x, unsigned int table_size){  struct entry const *p = x;  /* Ignoring the device number here should be fine.  */  /* The cast to uintmax_t prevents negative remainders     if st_ino is negative.  */  return (uintmax_t) p->st_ino % table_size;}/* Compare two dev/ino pairs.  Return true if they are the same.  */static boolentry_compare (void const *x, void const *y){  struct entry const *a = x;  struct entry const *b = y;  return SAME_INODE (*a, *b) ? true : false;}/* Try to insert the INO/DEV pair into the global table, HTAB.   If the pair is successfully inserted, return zero.   Upon failed memory allocation exit nonzero.   If the pair is already in the table, return nonzero.  */static inthash_ins (ino_t ino, dev_t dev){  struct entry *ent;  struct entry *ent_from_table;  ent = (struct entry *) xmalloc (sizeof *ent);  ent->st_ino = ino;  ent->st_dev = dev;  ent_from_table = hash_insert (htab, ent);  if (ent_from_table == NULL)    {      /* Insertion failed due to lack of memory.  */      xalloc_die ();    }  if (ent_from_table == ent)    {      /* Insertion succeeded.  */      return 0;    }  /* That pair is already in the table, so ENT was not inserted.  Free it.  */  free (ent);  return 1;}/* Initialize the hash table.  */static voidhash_init (void){  htab = hash_initialize (INITIAL_TABLE_SIZE, NULL,			  entry_hash, entry_compare, free);  if (htab == NULL)    xalloc_die ();}/* Print N_BYTES.  Convert it to a readable value before printing.  */static voidprint_only_size (uintmax_t n_bytes){  char buf[LONGEST_HUMAN_READABLE + 1];  fputs (human_readable (n_bytes, buf, human_output_opts,			 1, output_block_size), stdout);}/* Print N_BYTES followed by STRING on a line.   Convert N_BYTES to a readable value before printing.  */static voidprint_size (uintmax_t n_bytes, const char *string){  print_only_size (n_bytes);  printf ("\t%s\n", string);  fflush (stdout);}/* This function is called once for every file system object that nftw   encounters.  nftw does a depth-first traversal.  This function knows   that and accumulates per-directory totals based on changes in   the depth of the current entry.  */static intprocess_file (const char *file, const struct stat *sb, int file_type,	      struct FTW *info){  uintmax_t size;  uintmax_t size_to_print;  static int first_call = 1;  static size_t prev_level;  static size_t n_alloc;  static uintmax_t *sum_ent;  static uintmax_t *sum_subdir;  int print = 1;  /* Always define info->skip before returning.  */  info->skip = excluded_filename (exclude, file + info->base);  switch (file_type)    {    case FTW_NS:      error (0, errno, _("cannot access %s"), quote (file));      G_fail = 1;      return 0;    case FTW_DCHP:      error (0, errno, _("cannot change to parent of directory %s"),	     quote (file));      G_fail = 1;      return 0;    case FTW_DCH:      /* Don't return just yet, since although nftw couldn't chdir into the	 directory, it was able to stat it, so we do have a size.  */      error (0, errno, _("cannot change to directory %s"), quote (file));      G_fail = 1;      break;    case FTW_DNR:      /* Don't return just yet, since although nftw couldn't read the	 directory, it was able to stat it, so we do have a size.  */      error (0, errno, _("cannot read directory %s"), quote (file));      G_fail = 1;      break;    default:      break;    }  /* If this is the first (pre-order) encounter with a directory,     return right away.  */  if (file_type == FTW_DPRE)    return 0;  /* If the file is being excluded or if it has already been counted     via a hard link, then don't let it contribute to the sums.  */  if (info->skip      || (!opt_count_all

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区二区三区在线老狼| 岛国精品一区二区| 欧美一三区三区四区免费在线看| 亚洲图片欧美综合| 欧美精品一级二级三级| 午夜精品福利在线| 欧美变态tickle挠乳网站| 韩国女主播成人在线| 久久久久九九视频| kk眼镜猥琐国模调教系列一区二区| 国产精品久久久一本精品| 色综合视频一区二区三区高清| 亚洲日本乱码在线观看| 欧美日产国产精品| 精品亚洲aⅴ乱码一区二区三区| 欧美激情一区二区三区蜜桃视频| www.亚洲人| 日韩和欧美一区二区| 2024国产精品| 91麻豆福利精品推荐| 亚洲成av人片一区二区梦乃| 日韩精品最新网址| 99这里只有久久精品视频| 夜夜操天天操亚洲| 精品精品欲导航| 97aⅴ精品视频一二三区| 日本成人超碰在线观看| 日本一区二区电影| 精品污污网站免费看| 国产在线观看一区二区| 亚洲色欲色欲www在线观看| 91精品视频网| 99天天综合性| 精品亚洲porn| 一区二区三区欧美视频| 久久青草欧美一区二区三区| 91老司机福利 在线| 久久99久久久久| 亚洲香蕉伊在人在线观| 国产欧美一区二区精品久导航| 欧美日韩免费电影| 粉嫩在线一区二区三区视频| 丝袜a∨在线一区二区三区不卡| 欧美国产综合色视频| 91精品视频网| 欧美性一区二区| 国产91精品免费| 手机精品视频在线观看| 中文字幕一区日韩精品欧美| 91精品欧美综合在线观看最新 | 蜜桃传媒麻豆第一区在线观看| 中文字幕中文乱码欧美一区二区| 日韩你懂的电影在线观看| 色吊一区二区三区| 成人动漫一区二区在线| 一本一道波多野结衣一区二区 | 欧美一区二区三区四区在线观看| 亚洲男人天堂av| 色婷婷狠狠综合| 亚洲成人黄色小说| 成人av免费观看| 在线中文字幕不卡| 麻豆国产一区二区| 亚洲精品水蜜桃| 久久免费看少妇高潮| 色综合久久66| 国产酒店精品激情| 日韩高清不卡一区二区| 中文字幕不卡一区| 欧美挠脚心视频网站| 国产成人免费视| 狠狠色丁香婷婷综合| 蜜桃久久av一区| 国内欧美视频一区二区 | 欧美一区中文字幕| 国产一区二区成人久久免费影院| 一区二区三区波多野结衣在线观看| 久久久久久久久一| 国产一区二区在线看| 蜜桃视频免费观看一区| 日本免费新一区视频| 奇米精品一区二区三区四区| 日产国产欧美视频一区精品| 丝袜国产日韩另类美女| 日韩和欧美的一区| 免费精品视频在线| 久久精品二区亚洲w码| 久久精品国产第一区二区三区| 久久精品免费观看| 国模无码大尺度一区二区三区| 久草中文综合在线| 国产成a人亚洲精| fc2成人免费人成在线观看播放| av在线一区二区| 欧美四级电影网| 日韩一级大片在线观看| 精品人在线二区三区| 久久久精品蜜桃| 中文字幕中文字幕一区二区 | 久久精品久久精品| 国产乱码一区二区三区| www.亚洲精品| 欧美乱熟臀69xxxxxx| 欧美一区二区视频在线观看| 精品蜜桃在线看| 国产精品视频第一区| 一区二区三区国产精华| 日日摸夜夜添夜夜添精品视频| 久草在线在线精品观看| 成人中文字幕合集| 欧美体内she精视频| 日韩精品最新网址| 亚洲日本韩国一区| 琪琪久久久久日韩精品| 成人黄色av电影| 91麻豆精品国产自产在线 | 99久久精品国产毛片| 欧美手机在线视频| 久久久精品2019中文字幕之3| 最新欧美精品一区二区三区| 石原莉奈一区二区三区在线观看| 国产又黄又大久久| 欧美亚洲国产怡红院影院| 久久伊人中文字幕| 亚洲国产欧美在线| 国产成人在线观看免费网站| 色老头久久综合| 久久久国产一区二区三区四区小说| 一区二区免费视频| 国产精品一区二区果冻传媒| 欧美日韩视频在线第一区| 日本一区二区三区高清不卡| 亚洲成a人在线观看| 成人国产精品免费| 日韩女优av电影| 亚洲国产美国国产综合一区二区| 国产精品一区二区你懂的| 欧美日韩精品电影| 中文字幕中文字幕在线一区| 国产一区二区在线观看视频| 欧美日韩国产首页在线观看| 国产精品免费视频网站| 蜜桃久久精品一区二区| 欧美日韩免费观看一区三区| 国产精品久久久久久久第一福利| 美女性感视频久久| 欧美日韩亚洲综合在线| 亚洲视频免费在线观看| 国产精选一区二区三区| 日韩视频在线你懂得| 亚洲午夜激情av| 91成人网在线| 最新中文字幕一区二区三区 | 国产91精品在线观看| 精品国产一二三| 美女在线视频一区| 欧美福利一区二区| 亚洲成av人**亚洲成av**| 91美女在线观看| 亚洲免费资源在线播放| 成人免费视频一区二区| 国产三级精品三级| 国产成人在线影院| 久久久精品黄色| 国产成人午夜电影网| 欧美精品一区二区高清在线观看| 另类专区欧美蜜桃臀第一页| 日韩视频免费直播| 毛片av一区二区三区| 日韩免费性生活视频播放| 日本不卡123| 精品免费一区二区三区| 精品一二三四在线| 久久久91精品国产一区二区三区| 国产一区二区调教| 久久久久久久久蜜桃| 国产成人av福利| 国产精品久久久久三级| 91女厕偷拍女厕偷拍高清| 一区二区三区四区在线免费观看| 91福利国产精品| 亚洲成人www| 日韩精品一区二区三区四区| 国产在线日韩欧美| 日本一区二区三区四区 | 在线一区二区三区四区五区 | 精品视频123区在线观看| 日韩精品免费视频人成| 欧美大片顶级少妇| 国产高清不卡二三区| 亚洲天堂a在线| 欧美三级三级三级爽爽爽| 欧美aaaaa成人免费观看视频| 日韩精品一区二| av一二三不卡影片| 亚洲综合图片区| 欧美精品粉嫩高潮一区二区| 精品写真视频在线观看| 亚洲少妇30p| 91精品欧美福利在线观看|