Changeset 13041 for trunk/Nebulous/bin/neb-df
- Timestamp:
- Apr 26, 2007, 10:27:33 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/bin/neb-df (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/bin/neb-df
r13023 r13041 3 3 # Copyright (C) 2005 Joshua Hoblitt 4 4 # 5 # $Id: neb-df,v 1. 1 2007-04-25 19:52:49jhoblitt Exp $5 # $Id: neb-df,v 1.2 2007-04-26 20:27:33 jhoblitt Exp $ 6 6 7 7 use strict; … … 47 47 my $sql = Nebulous::Server::SQL->new(); 48 48 49 # get a list of Nebulous volume names 50 my $query = $dbh->prepare("SELECT * FROM volume"); 49 # ask the db to generate the table of mounted Nebulous volume 50 $dbh->do("call getmountedvol()"); 51 52 # suck that table into an AoH 53 my $query = $dbh->prepare("SELECT * FROM mountedvol"); 51 54 $query->execute(); 52 55 53 my $mount_query = $dbh->prepare("SELECT *, INSTR(?, mountpoint) = 1 as substring FROM mount ORDER BY substring DESC, LENGTH(mountpoint) DESC LIMIT 1");54 55 56 my @stats; 56 57 # use the list of Nebulous volume names to look for the corresponding 58 # mountpoint 59 while (my $volume_row = $query->fetchrow_hashref) { 60 $mount_query->execute($volume_row->{path}); 61 my $mount_row = $mount_query->fetchrow_hashref; 62 63 # assemble a hash that combines the neb volume info with the filesystem 64 # info 65 my $vol = {%{$volume_row}, %{$mount_row}}; 66 push @stats, $vol; 57 while (my $mountedvol = $query->fetchrow_hashref) { 58 push @stats, $mountedvol; 67 59 } 68 60
Note:
See TracChangeset
for help on using the changeset viewer.
