Ensure File.cp_r/3 reports non-existing destination properly (instead of source)
Module
File
33 changes across 18 versions
Changes by version
Properly handle permissions errors cascading from parent in File.mkdir_p/1
Passing a callback as third argument to File.cp/3 is deprecated, pass it as a on_conflict: callback option instead
Passing a callback as third argument to File.cp_r/3 is deprecated, pass it as a on_conflict: callback option instead
Add :offset option to File.stream!/2
Deprecate File.stream!(file, options, line_or_bytes) in favor of keeping the options as last argument, as in File.stream!(file, line_or_bytes, options)
Support distributed File.Stream
Do not raise if there are file system race conditions in File.cp/2
Do not raise when deleting write-only empty directories on File.rm_rf/1
File.cp/3 and File.cp_r/3 with a function as third argument
Support dereference_symlinks: true in File.cp/3 and File.cp_r/3
Passing a callback as third argument to File.cp/3 and File.cp_r/3 is deprecated.
Add File.rename!/2
Allow :raw option in File.exists?/2, File.regular?/2, and File.dir?/2
Allow POSIX time as an integer in File.touch/2 and File.touch!/2
Allow the :trim_bom option to be used with :encoding
Add File.read_link/1 and File.read_link!/1
Introduce :trim_bom option for File.stream!/2
Ensure recursive file operations raise on paths with null bytes (security issue reported by Griffin Byatt)
Support :ram/:raw files in File.copy/2
Support IO devices in File.copy/3
Add File.lstat/1 and File.lstat/1 that works like File.stat/1 but is able to return symlink information (i.e. it does not traverse symlinks)
Add File.rename/2
Ensure File.touch/2 and File.stat/2 receive and return universal times. Previously they would work with local times which are not monotonically increasing, which could present issues on scripts. If the times are being shown to the user, time: :local can be given as argument
File.rm now consistently deletes read-only across operating systems
Add File.ln_s/1
File.stream_to!/3 is deprecated
File.cp/3 and File.cp_r/3 no longer carry Unix semantics where the function behaves differently if the destination is an existing previous directory or not. It now always copies source to destination, doing it recursively in the latter
Add File.stream_to!/3
File.binstream!/3 is deprecated. Simply use File.stream!/3 which is able to figure out if stream or binstream operations should be used
Fix a bug where File.touch(file, datetime) was not setting the proper datetime when the file did not exist
File.iterator/1 and File.biniterator/1 are deprecated in favor of IO.stream/1 and IO.binstream/1
File.iterator!/2 and File.biniterator!/2 are deprecated in favor of File.stream!/2 and File.binstream!/2