我如何在perl中创建文件 [英] How i create a file in perl

查看:536
本文介绍了我如何在perl中创建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本文件的大小(比如1MB),我有保存文本文件的位置(比如C:/),我如何在perl中创建一个大小为1MB的文件,哪个应该保存在C:/。给我一些建议或想法。感谢您的帮助。

解决方案

请参阅:` perldoc -f sysopen `
和:` perldoc -f syswrite `


perldoc -f sysopen:它是用于创建文件的代码还是我需要在此搜索code ..


sysopen和syswrite是用于打开和写入文件的Perl函数。


perldoc是一个从命令行运行的命令访问Perl文档。


您也可以在线访问文档。
http://perldoc.perl.org/functions/sysopen.html
http://perldoc.perl.org/functions/sys write.html

I have the size of a text file (say 1MB) and i have the location to save the text file (say C:/) , how do i create a file in perl which should be 1MB size and which should save in C:/. Give me some suggestions or ideas. Your help will be appreciated.

解决方案

See: `perldoc -f sysopen`
and: `perldoc -f syswrite`


perldoc -f sysopen: Is it a code for creating a file or i need to search on this code..


sysopen and syswrite are Perl functions for opening and writing to files.

perldoc is a command that you run from the command line to access the Perl documentation.

You can also access the documentation online.
http://perldoc.perl.org/functions/sysopen.html
http://perldoc.perl.org/functions/syswrite.html


这篇关于我如何在perl中创建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆