{"id":17274180,"url":"https://github.com/davidthorn/filemanagerextensions","last_synced_at":"2025-06-21T10:05:25.907Z","repository":{"id":122657420,"uuid":"117783163","full_name":"davidthorn/FileManagerExtensions","owner":"davidthorn","description":null,"archived":false,"fork":false,"pushed_at":"2018-01-17T06:44:07.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T10:03:29.917Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidthorn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-17T04:19:22.000Z","updated_at":"2018-01-17T05:46:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb0f7b4a-7966-4cad-8eaa-c2ee44c59dd4","html_url":"https://github.com/davidthorn/FileManagerExtensions","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/davidthorn/FileManagerExtensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidthorn%2FFileManagerExtensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidthorn%2FFileManagerExtensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidthorn%2FFileManagerExtensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidthorn%2FFileManagerExtensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidthorn","download_url":"https://codeload.github.com/davidthorn/FileManagerExtensions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidthorn%2FFileManagerExtensions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261103157,"owners_count":23109928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T08:53:18.896Z","updated_at":"2025-06-21T10:05:20.892Z","avatar_url":"https://github.com/davidthorn.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FileManagerExtensions\n\nI created this package because the FileManager itself is too complicated and I always forgot which methods need to be called etc.\n\nFile management should be a simple thing and as easy as writing a terminal command like touch.\n\n## Extensions\n\n### homeDirectory\n\n\n```swift\n\nextension FileManager {\n\n    /// Returns the users home directory path\n    ///\n    /// - :Returns String\n    public var homeDirectory: String\n\n}\n\n```\n## mkdir\n\n```swift\n\nextension FileManager {\n\n    /// attempts to make the directory at the path name provided\n    ///      \n    /// - : Parameter path: The path which should be used to create the directory\n    /// - : Returns Bool    true if directory has been created, false if not\n    public func mkdir(path name: String ) -\u003e Bool \n\n}\n\n```\n\n## convertPathIncludingTilde\n\n```swift\n\nextension FileManager {\n\n    /// Converts the tilde (~) if provided to the full path\n    ///\n    /// - Parameter using: the path to the file which should be converted to an absolute strng\n    /// - Returns: A new string with the tilde remove if was present else the original string\n    public func convertPathIncludingTilde(using relativePath: String ) -\u003e String\n\n}\n \n```\n\n## tilde\n\n```swift\n\nextension String {\n\n    /// returns an tilde in the string if it has an index of 0\n    ///\n    /// - :Returns tilde character as a string\n    public var tilde: String?\n\n}\n\n\n```\n\n## FileManager.createFile\n\n```swift\n\nextension FileManager {\n\n    /// writes the contents of the data to the filename\n    ///\n    /// - Parameter: with the name of the filename \n    /// - Parameter: using data\n    /// - Returns: true if the data has been written or false for all other reasons\n    public func createFile(with filename: String, using data: Data? = nil ) -\u003e Bool \n\n}\n\n```\n\n## String.createFile\n\n```swift\n\nextension String {\n\n    /// writes the contents of the string to the filename\n    ///\n    /// - Parameter: with the name of the filename \n    /// - Returns: true if the data has been written or false for all other reasons\n    public func createFile(with filename: String ) -\u003e Bool \n\n}\n\n```\n\n## touch\n\n```swift\n\n    /// writes the contents of the string to the filename\n    ///\n    /// - Parameter: filename the name of the filename \n    /// - Returns: true if the data has been written or false for all other reasons\n    func touch(filename: String) -\u003e Bool\n\n```\n\n## String.touch\n\n```swift\n\nextension String {\n\n    /// creates a file using the filename\n    /// \n    /// The filename can be either relative using the ~\n    /// The tilde will be automatically converted to use its absolute path\n    ///\n    /// - Parameter: filename the name of the filename \n    /// - Returns: true if the file has been created otherwise false\n    public func touch(filename: String ) -\u003e Bool \n\n}\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidthorn%2Ffilemanagerextensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidthorn%2Ffilemanagerextensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidthorn%2Ffilemanagerextensions/lists"}