原创 TCL Open 命令

2012-12-3 12:14 4159 14 11 分类: MCU/ 嵌入式 文集: TCL/TK

open fileName

open fileName access

Description

This command opens a file, serial port, or command pipeline and returns a channel identifier that may be used in future invocations of commands like read, puts, and close. If the first character of fileName is not | then the command opens a file: fileName gives the name of the file to open, and it must conform to the conventions described in the filename manual entry.

The access argument, if present, indicates the way in which the file (or command pipeline) is to be accessed. In the first form access may have any of the following values:

r
Open the file for reading only; the file must already exist. This is the default value if access is not specified.
r+
Open the file for both reading and writing; the file must already exist.
w
Open the file for writing only. Truncate it if it exists. If it does not exist, create a new file.
w+
Open the file for reading and writing. Truncate it if it exists. If it does not exist, create a new file.
a
Open the file for writing only. If the file does not exist, create a new empty file. Set the file pointer to the end of the file prior to each write.
a+
Open the file for reading and writing. If the file does not exist, create a new empty file. Set the initial access position to the end of the file.

All of the legal access values above may have the character b added as the second or third character in the value to indicate that the opened channel should be configured with the -translation binary option, making the channel suitable for reading or writing of binary data.

In the second form, access consists of a list of any of the following flags, all of which have the standard POSIX meanings. One of the flags must be either RDONLY, WRONLY or RDWR.

tcl

文章评论1条评论)

登录后参与讨论

coyoo 2012-5-3 11:13

如果要打开一个存在的文件并在原有的文件后面写入时,使用a选项。r和w选项会将原有内容清零。
相关推荐阅读
coyoo 2024-12-03 12:20
比较器检测模拟脉冲说明(四)
概述 说明(三)探讨的是比较器一般带有滞回(Hysteresis)功能,为了解决输入信号转换速率不够的问题。前文还提到,即便使能滞回(Hysteresis)功能,还是无法解决SiPM读出测试系统需要解...
coyoo 2024-11-16 13:54
不同ADC采样同一前端模拟信号时转换用时差异分析
概述 同一组前端模拟信号接入由不同型号ADC组成的模数转换电路时,采样后在FPGA中发现采样用时差异较大。本文主要分析这个时间差异形成的原因,并记录该差异产生对系统造成的影响。系统数字化简介 项目前端...
coyoo 2024-11-10 13:04
ALTERA Cyclone 10器件的使用-7:FPGA片内RAM资源利用率思考
概述 项目使用的FPGA目标器件为Cyclone 10 GX系列规模最大一颗料,由于功能升级增加了功能模块更多,发现器件片内RAM不够使用了。为了探索片内RAM使用的利用率问题,从代码RTL级与编译软...
coyoo 2024-11-10 12:30
转知乎:幽灵般的人体成像技术-PET
幽灵般的人体成像技术——PET - 知乎...
coyoo 2024-11-09 10:26
AD9633默认情况下调试记录(二)
概述 所谓默认情况,即如器件手册中图2所标示那样。对应AD9633的调试,除了涉及到ADC自身,还需要兼顾前端驱动器,系统中AD9633驱动器使用了差分运算放大器,这里不在赘述,笔者已有相关文章论述。...
coyoo 2024-11-07 10:40
AD9633默认情况下调试记录(一)
AD9633在旁路SPI接口时如何在FPGA逻辑中确认字边界概述 AD9633与FPGA之间的LVDS接口初调试,ADC可以通过SPI接口对其内部寄存器进行各项配置。在SPI接口未调通之前,对LVDS...
我要评论
1
14
关闭 站长推荐上一条 /2 下一条