source: branches/2.2/filemanager/tp/dompdf/lib/ttf2ufm/ttf2ufm-src/scripts/inst_dir @ 3019

Revision 3019, 842 bytes checked in by amuller, 14 years ago (diff)

Ticket #1135 - Corrigindo CSS e adicionando filemanager

Line 
1#!/usr/bin/perl
2#
3# Script to create a directory for installation
4#
5# (c) 2000 by The TTF2PT1 Project
6# See COPYRIGHT for full license
7#
8
9if( $#ARGV!=0 && $#ARGV !=3) {
10        die "Use: $0 dir-name [owner group mode]\n"
11}
12
13if( $#ARGV==3 ) {
14        $owner = $ARGV[1];
15        $group = $ARGV[2];
16        eval "\$mode = 0$ARGV[3];";
17} else {
18        $owner = "root";
19        $group = "bin";
20        $mode = 0755;
21}
22
23@sl = split(/\//, $ARGV[0]);
24$prefix = shift(@sl);
25if($prefix eq "") {
26        $prefix = "/" . shift(@sl);
27}
28
29while(1) {
30        if( ! -d "$prefix" ) {
31                die "Unable to create directory $prefix:\n$!\n"
32                        unless mkdir($prefix, $mode);
33                die "Unable to change owner of $prefix to $owner\n"
34                        if system("chown $owner $prefix");
35                die "Unable to change group of $prefix to $group\n"
36                        if system("chgrp $group $prefix");
37        }
38        if($#sl < 0) {
39                last;
40        }
41        $prefix .= "/" . shift(@sl);
42}
43exit(0);
Note: See TracBrowser for help on using the repository browser.