P5-file-ncopy

Jul 20, 2023

Copy file(s) to directories/file

FileNCopycopy copies files to directories, or a single file to another file. You can also use a reference to a file handle if you wish when doing a file to file copy. The functionality is very similar to cp. If the argument is a directory to directory copy and the recursive flag is set then it is done recursively like cp -R. In fact it behaves like cp on Unix for the most part.

If called in array context, an array of successful copies is returned, otherwise the number of successful copies is returned. If passed a file handle, it’s difficult to make sure the file we are copying isn’t the same that we are copying to, since by opening the file in write mode it gets pooched. To avoid this use file names instead, if at all possible, especially for the to file. If passed a file handle, it is not closed when copy returns, files opened by copy are closed.



Checkout these related ports:
  • Zziplib - Library to provide transparent read access to zipped files
  • Zydis - Fast and lightweight x86/x86-64 disassembler library
  • Zycore-c - Support library with platform independent types, macros, etc for Zydis
  • Zthread - Platform-independent object-oriented C++ threading library
  • Zookeeper - Coordination Service for Distributed Applications
  • Zls - Zig LSP implementation + Zig Language Server
  • Zfp - High throughput library for compressed floating-point arrays
  • Zeal - Offline documentation browser
  • Zapcc - C++ caching compiler based on clang
  • Zanata-platform - Web-based translation platform
  • Zanata-cli - Zanata Java command line client
  • Z88dk - Complete Z80/Z180 development kit
  • Z80ex - ZiLOG Z80 CPU emulator library
  • Z80asm - Assembler for the Z80 microprocessor
  • Z80-asm - Z80 assembly code assembler and disassembler