From 495331bf20d5c3147290f0393581c4bd7292c89c Mon Sep 17 00:00:00 2001 From: oskca Date: Thu, 11 Jan 2018 13:40:25 +0800 Subject: raiseOSError to indicate the failling of findNextFile in walkDir[Rec] --- lib/pure/os.nim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/pure') diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 689fc8d4a..1e3224537 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -672,7 +672,10 @@ template walkCommon(pattern: string, filter) = if dotPos < 0 or idx >= ff.len or ff[idx] == '.' or pattern[dotPos+1] == '*': yield splitFile(pattern).dir / extractFilename(ff) - if findNextFile(res, f) == 0'i32 and getLastError() == 18: break # ERROR_NO_MORE_FILES=18 + if findNextFile(res, f) == 0'i32: + let errCode = getLastError() + if errCode == ERROR_NO_MORE_FILES: break + else: raiseOSError(errCode, "findNextFile failed") else: # here we use glob var f: Glob @@ -782,7 +785,10 @@ iterator walkDir*(dir: string; relative=false): tuple[kind: PathComponent, path: let xx = if relative: extractFilename(getFilename(f)) else: dir / extractFilename(getFilename(f)) yield (k, xx) - if findNextFile(h, f) == 0'i32 and getLastError() == 18: break # ERROR_NO_MORE_FILES=18 + if findNextFile(res, f) == 0'i32: + let errCode = getLastError() + if errCode == ERROR_NO_MORE_FILES: break + else: raiseOSError(errCode, "findNextFile failed") else: var d = opendir(dir) if d != nil: -- cgit 1.4.1-2-gfad0 r'>author
path: root/widgets/spinner.go
blob: 56f75cd4a815b5d1a62e54335dc9ebab0221c8ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89