File tree Expand file tree Collapse file tree 1 file changed +37
-10
lines changed Expand file tree Collapse file tree 1 file changed +37
-10
lines changed Original file line number Diff line number Diff line change @@ -165,26 +165,53 @@ Returns `true` if `path` is a FIFO, `false` otherwise.
165
165
166
166
Returns `true` if `path` is a character device, `false` otherwise.
167
167
"""
168
- ischardev (st:: StatStruct ) = filemode (st) & 0xf000 == 0x2000
168
+ ischardev (st:: StatStruct ) = filemode (st) & 0xf000 == 0x2000
169
169
170
- """
171
- isdir(path) -> Bool
170
+ """
171
+ isdir(path) -> Bool
172
+
173
+ Returns `true` if `path` is a directory, `false` otherwise.
174
+
175
+ # Examples
176
+ ```jldoctest
177
+ julia> isdir(homedir())
178
+ true
172
179
173
- Returns `true` if `path` is a directory, `false` otherwise.
174
- """
175
- isdir (st:: StatStruct ) = filemode (st) & 0xf000 == 0x4000
180
+ julia> f = open("test_file.txt", "w")
181
+ IOStream(<file test_file.txt>)
182
+
183
+ julia> isdir(f)
184
+ false
185
+
186
+ julia> close(f)
187
+ ```
188
+ """
189
+ isdir (st:: StatStruct ) = filemode (st) & 0xf000 == 0x4000
176
190
177
- """
178
- isblockdev(path) -> Bool
191
+ """
192
+ isblockdev(path) -> Bool
179
193
180
- Returns `true` if `path` is a block device, `false` otherwise.
181
- """
194
+ Returns `true` if `path` is a block device, `false` otherwise.
195
+ """
182
196
isblockdev (st:: StatStruct ) = filemode (st) & 0xf000 == 0x6000
183
197
184
198
"""
185
199
isfile(path) -> Bool
186
200
187
201
Returns `true` if `path` is a regular file, `false` otherwise.
202
+
203
+ # Examples
204
+ ```jldoctest
205
+ julia> isfile(homedir())
206
+ false
207
+
208
+ julia> f = open("test_file.txt", "w");
209
+
210
+ julia> isfile(f)
211
+ true
212
+
213
+ julia> close(f)
214
+ ```
188
215
"""
189
216
isfile (st:: StatStruct ) = filemode (st) & 0xf000 == 0x8000
190
217
You can’t perform that action at this time.
0 commit comments