module Cd::AsAnyEntry

Overview

Manupulates a file or directory path.

Direct including types

Defined in:

lib/as_any_entry.cr

Instance Method Summary

Instance Method Detail

def append(text) #

Appends text to this entry as a file.


[View source]
def basedir #

Returns a new DirEntry that contains this entry.


[View source]
def basename(suffix : String | Nil = nil) #

Returns this entry's base name.


[View source]
def chmod(mode : Int) #

Changes this entry's mode.


[View source]
def cp(dst : String) #

Copies this entry as a file to the dst path.


[View source]
def cp(dst : AsAnyEntry) #

Copies this entry as a file to the dst path.


[View source]
def directory?(*args) #

Tests if this entry is a directory.


[View source]
def dirname #

Returns a directory path that contains this entry.


[View source]
def executable?(*args) #

Tests if this entry is executable.


[View source]
def exists? #

Tests if this entry exists.


[View source]
def file?(*args) #

Tests if this entry is a file.


[View source]
def join(*args) #

Joins this entry's path and given path components.


[View source]
def read #

Reads this entry as a file.


[View source]
def real_path #

Returns this entry's real path.


[View source]
def remove #

Removes this entry.


[View source]
def symlink? #

Tests if this entry is a symlink.


[View source]
def to_dir #

Creates a new DirEntry with this entry's path.


[View source]
def to_s(io : IO) #

Writes this entry's path to the IO.


[View source]
def touch(mode : Int | Nil = nil) #

Creates an empty file if this entry does not exists.


[View source]
def write(text, mode : Int | Nil = nil) #

Writes text to this entry as a file.


[View source]