#!/bin/sh # # Written by Alex Kuchma # Alex Tkachenko # Updated by Vitezslav Samel # # (C) 1997, 1998 The Free Software Foundation. # # XAR=ar mcarfs_list () { # Fix by Hatred $XAR tv "$1" | sed 's,^,-,;s, , 1 ,;s,/, ,' | awk '{printf "%9s %d %-8s %-8s %8d %s %s %s %s\n", $1, $2, $3, $4, $5, $6, $7, $8, $10}' } mcarfs_copyout () { $XAR p "$1" "$2" > "$3" } mcarfs_copyin () { TMPDIR=/tmp/mctmpdir-uar.$$ mkdir $TMPDIR || exit 1 name=`basename "$2"` (cd $TMPDIR && cp -fp "$3" $name && $XAR r "$1" $name) rm -rf $TMPDIR } mcarfs_rm () { $XAR d "$1" "$2" } # override any locale for dates LC_ALL=C export LC_ALL umask 077 case "$1" in list) mcarfs_list "$2" ;; copyout) shift; mcarfs_copyout "$@" ;; copyin) shift; mcarfs_copyin "$@" ;; rm) shift; mcarfs_rm "$@" ;; *) exit 1; esac exit 0