src/pylib/Lib/shutil

Source   Edit  

Types

SameFileError = object of Error
Source   Edit  

Procs

proc copy[T](src`gensym6, dst`gensym6: PathLike[T];
             follow_symlinks`gensym6 = true)
Source   Edit  
proc copyfile[T](src`gensym5, dst`gensym5: PathLike[T];
                 follow_symlinks`gensym5 = true)
Source   Edit  
proc copyfileobj(s, d: File; length = COPY_BUFSIZE) {.
    ...raises: [IOError, OSError], tags: [WriteIOEffect, ReadIOEffect], forbids: [].}

shutil.copyfileobj but for Nim's File

if length is negative, it means copying the data without looping over the source data in chunks

Source   Edit  
proc get_terminal_size(fallback = (80, 24)): terminal_size {....raises: [],
    tags: [ReadEnvEffect], forbids: [].}
Hint: this does not simply refer to environment variable,

call os.get_terminal_size. This is a wrapper around terminalSize of std/terminal, which is more steady, returning meaningful result even when stdout is not associatd with a terminal.

Source   Edit