@@ -258,239 +258,6 @@ Returns:
258258
259259- The result(s) of the call to ` callback `
260260
261- ### Path Manipulation Functions
262-
263- This library includes wrappers around the following functions from
264- the [ filepath] library for the current platform (POSIX or
265- Windows). All examples below are for [ POSIX systems] .
266-
267- #### drop_extension
268-
269- ` drop_extension (filepath) `
270-
271- Remove last extension, and the ` . ` preceding it.
272-
273- ``` lua
274- drop_extension (" /directory/path.ext" ) == " /directory/path"
275- ```
276-
277- Parameters:
278-
279- ` filepath `
280- : path (string)
281-
282- Returns:
283-
284- - The modified filepath without extension (string).
285-
286- This function wraps [ System.FilePath.dropExtension] .
287-
288- #### has_extension
289-
290- ` has_extensions (filepath) `
291-
292- Does the given filename have an extension?
293-
294- ``` lua
295- has_extension (" /directory/path.ext" ) == true
296- has_extension (" /directory/path" ) == false
297- ```
298-
299- Parameters:
300-
301- ` filepath `
302- : path (string)
303-
304- Returns:
305-
306- - ` true ` iff ` filepath ` has an extension, ` false ` otherwise
307- (boolean).
308-
309- This function wraps [ System.FilePath.hasExtension] .
310-
311- #### is_absolute
312-
313- ` is_absolute (filepath) `
314-
315- Is a path absolute? (same as ` not is_relative(filepath) ` )
316-
317- Parameters:
318-
319- ` filepath `
320- : path (string)
321-
322- Returns:
323-
324- - ` true ` iff ` filepath ` is an absolute path, ` false ` otherwise
325- (boolean).
326-
327- This function wraps [ System.FilePath.isAbsolute] .
328-
329- #### is_relative
330-
331- ` ìs_relative (filepath) `
332-
333- Is a path relative, or is it fixed to the root?
334-
335- ``` lua
336- is_relative (" test/path" ) == true
337- is_relative (" /test" ) == false
338- is_relative (" /" ) == false
339- ```
340-
341- Parameters:
342-
343- ` filepath `
344- : path (string)
345-
346- Returns:
347-
348- - ` true ` iff ` filepath ` is a relative path, ` false ` otherwise
349- (boolean).
350-
351- This function wraps [ System.FilePath.isRelative] .
352-
353- #### join_path
354-
355- ` join_path (filepaths) `
356-
357- Join path elements back together by the directory separator.
358-
359- ``` lua
360- join_path ({" /" ," directory/" ," file.ext" }) == " /directory/file.ext"
361- ```
362-
363- Parameters:
364-
365- ` filepaths `
366- : list of path strings
367-
368- Returns:
369-
370- - The joined path (string).
371-
372- This function wraps [ System.FilePath.joinPath] .
373-
374- #### normalise
375-
376- ` normalise (filepath) `
377-
378- Normalise a path. See examples [ here] [ System.FilePath.normalize ] .
379- <!-- TODO explain so it becomes understandable without a link -->
380-
381- Parameters:
382-
383- ` filepath `
384- : path (string)
385-
386- Returns:
387-
388- - The normalised path (string).
389-
390- This function wraps [ System.FilePath.normalise] .
391-
392- #### split_directories
393-
394- ` split_directories (filepath) `
395-
396- Split a path by the directory separator.
397-
398- ``` lua
399- split_directories (" /directory/file.ext" ) == {" /" ," directory" ," file.ext" }
400- split_directories (" test/file" ) == {" test" ," file" }
401- split_directories (" /test/file" ) == {" /" ," test" ," file" }
402- ```
403-
404- Parameters:
405-
406- ` filepath `
407- : path (string)
408-
409- Returns:
410-
411- - A list of all directory paths (list of strings).
412-
413- This function wraps [ System.FilePath.splitDirectories] .
414-
415- #### take_directory
416-
417- ` take_directory (filepath) `
418-
419- Get the directory name, move up one level.
420-
421- ``` lua
422- take_directory (" /foo/bar/baz" ) == " /foo/bar"
423- take_directory (" /foo/bar/baz/" ) == " /foo/bar/baz"
424- ```
425-
426- Parameters:
427-
428- ` filepath `
429- : path (string)
430-
431- Returns:
432-
433- - The filepath up to the last directory separator (string).
434-
435- This function wraps [ System.FilePath.takeDirectory] .
436-
437- #### take_extensions
438-
439- ` take_extensions (filepath) `
440-
441- Get all extensions.
442-
443- ``` lua
444- take_extensions (" /directory/path.ext" ) == " .ext"
445- take_extensions (" file.tar.gz" ) == " .tar.gz"
446- ```
447-
448- Parameters:
449-
450- ` filepath `
451- : path (string)
452-
453- Returns:
454-
455- - String of all extensions (string).
456-
457- This function wraps [ System.FilePath.takeExtensions] .
458-
459- #### take_filename
460-
461- ` take_filename (filepath) `
462-
463- Get the file name.
464-
465- ``` lua
466- take_filename (" /directory/file.ext" ) == " file.ext"
467- take_filename (" test/" ) == " "
468- ```
469-
470- Parameters:
471-
472- ` filepath `
473- : path (string)
474-
475- Returns:
476-
477- - The file name (string).
478-
479- This function wraps [ System.FilePath.takeFileName] .
480-
481-
482- [ filepath ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath.html
483- [ POSIX systems ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html
484- [ System.FilePath.dropExtension ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:dropExtension
485- [ System.FilePath.hasExtension ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:hasExtension
486- [ System.FilePath.isAbsolute ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:isAbsolute
487- [ System.FilePath.isRelative ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:isRelative
488- [ System.FilePath.joinPath ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:joinPath
489- [ System.FilePath.normalise ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:normalise
490- [ System.FilePath.splitDirectories ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:splitDirectories.
491- [ System.FilePath.takeDirectory ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:takeDirectory
492- [ System.FilePath.takeExtensions ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:takeExtensions.
493- [ System.FilePath.takeFileName ] : https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:takeFileName.
494261
495262License
496263-------
0 commit comments