void dirsizes_cmd (void) { WPanel *panel = current_panel; int i; ComputeDirSizeUI *ui; ui = compute_dir_size_create_ui (); for (i = 0; i < panel->count; i++) if (S_ISDIR (panel->dir.list[i].st.st_mode) && ((panel->dirs_marked && panel->dir.list[i].f.marked) || !panel->dirs_marked) && strcmp (panel->dir.list[i].fname, "..") != 0) { size_t marked = 0; uintmax_t total = 0; if (compute_dir_size (panel->dir.list[i].fname, ui, compute_dir_size_update_ui, &marked, &total, TRUE) != FILE_CONT) break; panel->dir.list[i].st.st_size = (off_t) total; panel->dir.list[i].f.dir_size_computed = 1; } compute_dir_size_destroy_ui (ui); recalculate_panel_summary (panel); if (current_panel->sort_info.sort_field->sort_routine == (sortfn *) sort_size) panel_re_sort (panel); panel->dirty = 1; }
void single_dirsize_cmd (void) { WPanel *panel = current_panel; file_entry *entry; entry = &(panel->dir.list[panel->selected]); if (S_ISDIR (entry->st.st_mode) && strcmp (entry->fname, "..") != 0) { size_t marked = 0; uintmax_t total = 0; ComputeDirSizeUI *ui; ui = compute_dir_size_create_ui (); if (compute_dir_size (entry->fname, ui, compute_dir_size_update_ui, &marked, &total, TRUE) == FILE_CONT) { entry->st.st_size = (off_t) total; entry->f.dir_size_computed = 1; } compute_dir_size_destroy_ui (ui); } if (panels_options.mark_moves_down) send_message ((Widget *) panel, WIDGET_COMMAND, CK_Down); recalculate_panel_summary (panel); if (current_panel->sort_info.sort_field->sort_routine == (sortfn *) sort_size) panel_re_sort (panel); panel->dirty = 1; }
void single_dirsize_cmd (void) { WPanel *panel = current_panel; file_entry_t *entry; entry = &(panel->dir.list[panel->selected]); if (S_ISDIR (entry->st.st_mode) && !DIR_IS_DOTDOT (entry->fname)) { size_t dir_count = 0; size_t count = 0; uintmax_t total = 0; dirsize_status_msg_t dsm; vfs_path_t *p; p = vfs_path_from_str (entry->fname); memset (&dsm, 0, sizeof (dsm)); status_msg_init (STATUS_MSG (&dsm), _("Directory scanning"), 1.0, dirsize_status_init_cb, dirsize_status_update_cb, dirsize_status_deinit_cb); if (compute_dir_size (p, &dsm, &dir_count, &count, &total, TRUE) == FILE_CONT) { entry->st.st_size = (off_t) total; entry->f.dir_size_computed = 1; } vfs_path_free (p); status_msg_deinit (STATUS_MSG (&dsm)); } if (panels_options.mark_moves_down) send_message (panel, NULL, MSG_ACTION, CK_Down, NULL); recalculate_panel_summary (panel); if (current_panel->sort_field->sort_routine == (GCompareFunc) sort_size) panel_re_sort (panel); panel->dirty = 1; }
void dirsizes_cmd (void) { WPanel *panel = current_panel; int i; dirsize_status_msg_t dsm; memset (&dsm, 0, sizeof (dsm)); status_msg_init (STATUS_MSG (&dsm), _("Directory scanning"), 1.0, dirsize_status_init_cb, dirsize_status_update_cb, dirsize_status_deinit_cb); for (i = 0; i < panel->dir.len; i++) if (S_ISDIR (panel->dir.list[i].st.st_mode) && ((panel->dirs_marked && panel->dir.list[i].f.marked) || !panel->dirs_marked) && !DIR_IS_DOTDOT (panel->dir.list[i].fname)) { vfs_path_t *p; size_t dir_count = 0; size_t count = 0; uintmax_t total = 0; gboolean ok; p = vfs_path_from_str (panel->dir.list[i].fname); ok = compute_dir_size (p, &dsm, &dir_count, &count, &total, TRUE) != FILE_CONT; vfs_path_free (p); if (ok) break; panel->dir.list[i].st.st_size = (off_t) total; panel->dir.list[i].f.dir_size_computed = 1; } status_msg_deinit (STATUS_MSG (&dsm)); recalculate_panel_summary (panel); if (current_panel->sort_field->sort_routine == (GCompareFunc) sort_size) panel_re_sort (panel); panel->dirty = 1; }
void dirsizes_cmd (void) { WPanel *panel = current_panel; int i; off_t marked; double total; for (i = 0; i < panel->count; i++) if (S_ISDIR (panel->dir.list [i].st.st_mode) && ((panel->dirs_marked && panel->dir.list [i].f.marked) || !panel->dirs_marked) && strcmp (panel->dir.list [i].fname, "..") != 0) { total = 0.0l; compute_dir_size (panel->dir.list [i].fname, &marked, &total); panel->dir.list [i].st.st_size = (off_t) total; panel->dir.list [i].f.dir_size_computed = 1; } recalculate_panel_summary (panel); panel->dirty = 1; }
void single_dirsize_cmd (void) { WPanel *panel = current_panel; file_entry *entry; off_t marked; double total; entry = &(panel->dir.list[panel->selected]); if (S_ISDIR (entry->st.st_mode) && strcmp(entry->fname, "..") != 0) { total = 0.0; compute_dir_size (entry->fname, &marked, &total); entry->st.st_size = (off_t) total; entry->f.dir_size_computed = 1; } if (mark_moves_down) send_message (&(panel->widget), WIDGET_KEY, KEY_DOWN); recalculate_panel_summary (panel); panel->dirty = 1; }