~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to test/fts.awk

  • Committer: Juergen Kahrs
  • Date: 2014-06-24 11:18:33 UTC
  • mfrom: (408.2.336)
  • Revision ID: git-v1:f1245d04a9f076773c60499b468f44ed9c91b59b
Merge remote-tracking branch 'origin/master' into cmake

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
BEGIN {
4
4
        Level = 0
5
5
 
6
 
        system("rm -fr d1 d2")
7
 
        system("mkdir d1 d2 ; touch d1/f1 d1/f2 d2/f1 d2/f2")
 
6
        os = ""
 
7
        if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") {
 
8
                os = "VMS"
 
9
                system("create/dir/prot=o:rwed [.d1]")
 
10
                system("create/dir/prot=o:rwed [.d2]")
 
11
                system("copy fts.awk [.d1]f1")
 
12
                system("copy fts.awk [.d1]f2")
 
13
                system("copy fts.awk [.d2]f1")
 
14
                system("copy fts.awk [.d2]f2")
 
15
        } else {
 
16
                system("rm -fr d1 d2")
 
17
                system("mkdir d1 d2 ; touch d1/f1 d1/f2 d2/f1 d2/f2")
 
18
        }
8
19
        pathlist[1] = "d1"
9
20
        pathlist[2] = "d2"
10
21
        flags = FTS_PHYSICAL
19
30
        traverse(data2)
20
31
        close(output)
21
32
 
22
 
        system("rm -fr d1 d2")
 
33
        if (os == "VMS") {
 
34
                system("delete [.d1]*.*;*")
 
35
                system("delete [.d2]*.*;*")
 
36
                system("delete d1.dir;*")
 
37
                system("delete d2.dir;*")
 
38
        } else {
 
39
                system("rm -fr d1 d2")
 
40
        }
23
41
}
24
42
 
25
43
function indent(        i)
96
114
        for (i in stat_data)
97
115
                data_array[pathname]["."]["stat"][i] = stat_data[i]
98
116
 
 
117
        os = ""
 
118
        if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") {
 
119
                os = "VMS"
 
120
                # Command in next section not valid on VMS.
 
121
                return
 
122
        }
 
123
 
99
124
        command = ("ls -f " pathname)
100
125
        while ((command | getline direntry) > 0) {
101
126
                if (direntry == "." || direntry == "..")