The basic exception thrown by the ocean.io package. One should try to ensure that all Tango exceptions related to IO are derived from this one.
Thrown when an illegal argument is encountered.
Returns the time of the last access. Accurate to whatever the F/S supports, and in a format dictated by the file-system. For example NTFS keeps UTC time, while FAT timestamps are based on the local time.
Provides foreach support via a fruct, as in
Collate all files and folders from the given path whose name matches the given pattern. Folders will be traversed where recurse is enabled, and a set of matching names is returned as filepaths (including those folders which match the pattern.)
Transfer the content of one file to another. Throws an IOException upon failure.
Create a new file.
Create a new directory.
Create an entire path consisting of this folder along with all parent folders. The path should not contain '.' or '..' segments, which can be removed via the normalize() function.
Returns the time of file creation. Accurate to whatever the F/S supports, and in a format dictated by the file-system. For example NTFS keeps UTC time, while FAT timestamps are based on the local time.
Does this path currently exist?
Return the file length (in bytes.)
Is this file actually a normal file? Not a directory or (on unix) a device file or link.
Is this file actually a folder/directory?
Is this file writable?
Join a set of path specs together. A path separator is potentially inserted between each of the segments.
Returns the time of the last modification. Accurate to whatever the F/S supports, and in a format dictated by the file-system. For example NTFS keeps UTC time, while FAT timestamps are based on the local time.
Convert to native O/S path separators where that is required, such as when dealing with the Windows command-line.
Normalizes a path component.
Returns a path representing the parent of this one, with a special case concerning a trailing '/':
Parse a path into its constituent components.
Matches a pattern against a filename.
Returns a path representing the parent of this one:
Remove the file/directory from the file-system. Returns true if successful, false otherwise.
Remove the files and folders listed in the provided paths. Where folders are listed, they should be preceded by their contained files in order to be successfully removed. Returns a set of paths that failed to be removed (where .length is zero upon success).
Change the name or location of a file/directory.
Replace all path 'from' instances with 'to', in place (overwrites the provided path).
Break a path into "head" and "tail" components. For example:
Convert path separators to a standard format, using '/' as the path separator. This is compatible with Uri and all of the contemporary O/S which Tango supports. Known exceptions include the Windows command-line processor, which considers '/' characters to be switches instead. Use the native() method to support that.
Return timestamp information.
Set the accessed and modified timestamps of the specified file.
Wraps the O/S specific calls with a D API. Note that these accept null-terminated strings only, which is why it's not public. We need this declared first to avoid forward-reference issues.
Parses a file path.
Represents a point in time.
This struct represents a length of time. The underlying representation is in units of 100ns. This allows the length of time to span to roughly +/- 10000 years.
Tango Dual License: 3-Clause BSD License / Academic Free License v3.0. See LICENSE_TANGO.txt for details.
Copyright (c) 2008 Kris Bell. Normalization & Patterns copyright (c) 2006-2009 Max Samukha, Thomas Kühne, Grzegorz Adam Hankiewicz Some parts copyright (c) 2009-2016 dunnhumby Germany GmbH. All rights reserved.
Mar 2008: Initial version
Oct 2009: Added PathUtil code
A more direct route to the file-system than FilePath. Use this if you don't need path editing features. For example, if all you want is to check some path exists, using this module would likely be more convenient than FilePath:
These functions may be less efficient than FilePath because they generally attach a null to the filename for each underlying O/S call. Use Path when you need pedestrian access to the file-system, and are not manipulating the path components. Use FilePath where path-editing or mutation is desired.
We encourage the use of "named import" with this module, such as:
Also residing here is a lightweight path-parser, which splits a filepath into constituent components. FilePath is based upon the same PathParser:
Path normalization and pattern-matching is also hosted here via the normalize() and pattern() functions. See the doc towards the end of this module.