You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 22, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+94-77Lines changed: 94 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -257,39 +257,41 @@ Returns:
257
257
258
258
### Path Manipulation Functions
259
259
260
-
This library includes wrappers around the following functions from the [filepath](https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath.html) library for the current platform (POSIX or Windows). All examples below are for [POSIX systems](https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html).
260
+
This library includes wrappers around the following functions from
261
+
the [filepath] library for the current platform (POSIX or
This function wraps [System.FilePath.takeDirectory](https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:takeDirectory).
284
+
This function wraps [System.FilePath.dropExtension].
283
285
284
-
#### take_filename
286
+
#### has_extension
285
287
286
-
`take_filename(filepath)`
288
+
`has_extensions(filepath)`
287
289
288
-
Get the file name.
290
+
Does the given filename have an extension?
289
291
290
292
```lua
291
-
takeFileName("/directory/file.ext") =="file.ext"
292
-
takeFileName("test/") ==""
293
+
hasExtension("/directory/path.ext") ==true
294
+
hasExtension("/directory/path") ==false
293
295
```
294
296
295
297
Parameters:
@@ -299,20 +301,15 @@ Parameters:
299
301
300
302
Returns:
301
303
302
-
- The file name.
303
-
304
-
This function wraps [System.FilePath.takeFileName](https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:takeFileName).
304
+
-`true` if `filepath` has an extension.
305
305
306
-
#### take_extensions
306
+
This function wraps [System.FilePath.hasExtension].
307
307
308
-
`take_extensions(filepath)`
308
+
#### is_absolute
309
309
310
-
Get all extensions.
310
+
`is_absolute(filepath)`
311
311
312
-
```lua
313
-
takeExtensions("/directory/path.ext") ==".ext"
314
-
takeExtensions("file.tar.gz") ==".tar.gz
315
-
```
312
+
Is a path absolute? (same as `! is_relative(filepath)`)
316
313
317
314
Parameters:
318
315
@@ -321,18 +318,20 @@ Parameters:
321
318
322
319
Returns:
323
320
324
-
-String of all extensions.
321
+
-`true` if `filepath` is an absolute path.
325
322
326
-
This function wraps [System.FilePath.takeExtensions](https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:takeExtensions).
This function wraps [System.FilePath.dropExtension](https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:dropExtension).
346
+
This function wraps [System.FilePath.isRelative].
348
347
349
-
#### has_extension
348
+
#### join_path
350
349
351
-
`has_extensions(filepath)`
350
+
`join_path(filepaths)`
352
351
353
-
Does the given filename have an extension?
352
+
Join path elements back together by the directory separator.
Normalise a path. See examples [here][System.FilePath.normalize].
374
+
375
+
Parameters:
376
+
362
377
`filepath`
363
378
: path
364
379
365
380
Returns:
366
381
367
-
-`true` if `filepath` has an extension.
382
+
-The normalised path.
368
383
369
-
This function wraps [System.FilePath.hasExtension](https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:hasExtension).
384
+
This function wraps [System.FilePath.normalise].
370
385
371
386
#### split_directories
372
387
@@ -389,39 +404,39 @@ Returns:
389
404
390
405
- A list of all directory paths.
391
406
392
-
This function wraps [System.FilePath.splitDirectories](https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:splitDirectories).
407
+
This function wraps [System.FilePath.splitDirectories].
393
408
394
-
#### join_path
409
+
#### take_directory
395
410
396
-
`join_path(filepaths)`
411
+
`take_directory(filepath)`
397
412
398
-
Join path elements back together by the directory separator.
0 commit comments