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.
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.
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.
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 its
IO.umaskmethod have been removed without any replacement
.modehave been removed from
IO::Handle. You can call these on the path returned by
IO::Handle.pathmethod to obtain the same behaviour
&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 replace
chdir :test<r w x> …with
chdir :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
.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
- The order of arguments to
&symlinkhas been reversed. It now follows
$existing-thing, $thing-we-are-creatingpattern adhered to by
lncommand line tool as well as
IO::Handle.lockno longer takes an
Int: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
&homedirhas been removed. Use
$*HOMEdynamic variable directly.
&tempdirhas been removed. Use
$*TMPDIRdynamic variable directly.
- IO routines that used to throw will now
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