Upgrade Information for Changes Due to IO Grant Work
2017-04-02
As previously notified, there are changes being made to IO routines. This notice is to provide details on changes that may affect currently-existing code.
When?
Barring unforeseen delays, the work affecting version 6.c language is planned to be included in 2017.04 Rakudo Compiler release (planned for release on April 17, 2017) on which next Rakudo Star release will be based.
Some or all of the work affecting 6.d language may also be included in that release and will be available if the user uses use v6.d.PREVIEW pragma. Any 6.d work that doesn't make it into 2017.04 release, will be included in 2017.05 release.
If you use development commits of the compiler (e.g. rakudobrew), you will
receive this work as-it-happens.
Why?
If you only used documented features, the likelihood of you needing to change any of your code is low. The 6.c language changes due to IO Grant work affect either routines that are rarely used or undocumented routines that might have been used by users assuming they were part of the language.
What?
This notice describes only changes affecting existing code and only for 6.c language. It does NOT include any non-conflicting changes or changes slated for 6.d language. If you're interested in the full list of changes, you can find it in the IO Grant Action Plan
The changes that may affect existing code are:
role IOtogether with itsIO.umaskmethod have been removed without any replacement- Methods
.watch,.chmod,.IO,.e,.d,.f,.s,.l,.r,.w,.x,.modified,.accessed,.changed, and.modehave been removed fromIO::Handle. You can call these on the path returned byIO::Handle.pathmethod to obtain the same behaviour :testparameter on&chdir,IO::Path.chdir, and&indirroutines have been changed to issue a deprecation warning and will be removed in 6.d language. In addition, the default test performed by these routines has been changed to be only a test for whether the path is a directory. To upgrade your code for this change, simply use named parameters for the test. e.g replacechdir :test<r w x> …withchdir :r, :w, :x …- binary mode in
IO::Handle.Supplyis now controlled by whether the handle is in binary mode (e.g. opened with.open(:bin …)). The:binargument to.Supplyis now ignored. - In 2017.03 release,
IO::Path.lineswas made non-lazy (slurps the whole file). This has now been reverted. To ensure the filehandle gets closed, you need to exhaust the returned Seq (simply iterate through it;eagerit explicitly or implicitly (e.g. by assigning to array); or call.sinkon it) - The order of arguments to
&linkand&symlinkhas been reversed. It now follows$existing-thing, $thing-we-are-creatingpattern adhered to bylncommand line tool as well as&move,©and&renameroutines IO::Handle.lockno longer takes anInt:Dargument, but a pair of named arguments instead. By default, it makes an exclusive, blocking lock. Use:sharednamed argument to make a shared lock instead and:non-blockingto make the method fail instead of waiting for lock.IO::Path.new-from-absolute-pathis now a private method. Use.IOcoercer orIO::Path.new: $the-pathinstead&homedirhas been removed. Use$*HOMEdynamic variable directly.&tempdirhas been removed. Use$*TMPDIRdynamic variable directly.- IO routines that used to throw will now
failinstead.
Help and More Info
If you need help or more information, please join our IRC channel and ask there. You can also contact the person performing this work via Twitter @zoffix or by talking to user Zoffix in our dev IRC channel
