没找到打开gz压缩文件的标准库,暂时调用系统命令打开gz压缩文件(参考:https://dlang.org/phobos/std_process.html#.Redirect.stdoutToStderr)。

缺点是文件全部会读入内存处理,对于大文件不太友好。

 1 import std.stdio;
2 import std.process;
3 import std.string;
4
5 void main(string[] args){
6 string fileName = args[1];
7 string command = "gzip -dc " ~ fileName ;
8 auto dmd = executeShell(command);
9 if(dmd.status != 0){
10 writeln("Compilation failed:\n", dmd.output);
11 }
12 else{
13 auto all=chomp(dmd.output).split("\n");
14 writeln(typeid(all));
15 for(int i=0; i<all.length; i++){
16 writeln(all[i]);
17 }
18 }
19 }

最新文章

  1. 一鼓作气 博客--第七篇 note7
  2. input---checked小问题
  3. WP8图片缩放功能实现
  4. struts2文件上传和下载
  5. PHP面向对象——重写与重载
  6. ArcGis实现添加MultiLayerMarkerSymbol(多个符号叠加生成新的符号)
  7. 欧拉工程第56题:Powerful digit sum
  8. TortoiseGit&#39;s Settings
  9. Successfully installed matplotlib
  10. LaTex 下编译后不能显示中文,或者中文乱码
  11. 【Cocos2d-x 粒子系统】火球用手指飞起来
  12. java传值和通过引用传递
  13. 使用CXF开发JAX-WS类型的WebService
  14. AVFoundation 框架初探究(二)
  15. Spring-Security自定义登录页&amp;inMemoryAuthentication验证
  16. 深入 JAVA里面关于byte数组和String之间的转换问题
  17. [Swift]LeetCode885. 螺旋矩阵 III | Spiral Matrix III
  18. WPF自定义控件(三)の扩展控件
  19. docker-machine on azure
  20. Jvm 性能检测

热门文章

  1. Noip模拟7 2021.6.11
  2. 前端大牛带你了解JavaScript 函数式编程
  3. 最短路径算法:弗洛伊德(Floyd-Warshall)算法
  4. SPOJ GSS8 - Can you answer these queries VIII | 平衡树
  5. 前端面试手写代码——JS函数柯里化
  6. pvcreate vgcreate lvcreate 扩容
  7. Node.js躬行记(14)——压力测试
  8. selenium2.x 与 selenium3.x 最大区别
  9. 2021 羊城杯WriteUP
  10. Ubuntu安装BCC