PNFile 入门指南
1、产品概述 PNFile 是一个平台型工具,在该平台上集成了多个应用程序和实用工具。下图 1 所示,在 PNFile 中有 Directory Structure 和 PNPreview 这两个窗口,PNTree、PNEdit、PNDiff、PNFinder 和 PNCompare 这 5 个应用程序,以及 System Information、Encrypt/Decrypt、Split/Join 和 Directory Print 这 4 个实用工具。
图 1 PNFile 产品概述
2、工具安装和环境配置 PNFile 工具可以在当前主流的 Linux 或 Unix 操作系统上运行,其软件安装过程非常简单,在 Linux 或 Unix 系统上无需任何特殊设置,在安装完成之后配置软件安装路径和设定 license 文件即可启动工具命令。
2.1、安装 PNFile 工具 PNFile 已被打包成一个独立的软件包,用户无需下载安装任何第三方软件包,仅需安装 PNFile 包本身即可。用户可发邮件至邮箱 support@veriforma.com 获取 PNFile 软件包或从网站 www.veriforma.com 上直接下载即可。PNFile 工具包解压即可用,用户无需再安装或编译任何中间文件,将安装包解压至本地工具安装路径即完成工具安装过程。下图 2 所示为 PNFile 软件安装包解压之后的目录结构,在该软件包中有五个文件夹和两个 shell 设置文件。
图 2 PNFile 软件安装包
bin/ 包含了所有支持的命令。doc/ 用于存放软件的文档。lib/ PNFile 软件的库文件。lic/ 默认存放 license 文件。tools/ PNFile 软件需要调用的编译器工具。pn.bshrc 在 bshell 中设置工具的路径和 license。pn.cshrc 在 cshell 中设置工具的路径和 license。
2.2、环境变量设置对于 PNFile 工具环境变量设置用户需配置 LIC_FILE_PATH 和 PNFILE_PATH 这两个环境变量。LIC_FILE_PATH 环境变量用于设置 license 文件的全路径,PNFile 工具以及在该平台下的 PNTree、PNEdit、PNDiff、PNFinder 和 PNCompare 这 5 个应用程序在启动时都需要检查 license 文件,用户可发邮件至邮箱 sales@veriforma.com 获取 license 文件。PNFILE_PATH 环境变量用于设置 PNFile 软件包解压安装的全路径,PNFile 工具以及在该平台下的 PNTree、PNEdit、PNDiff、PNFinder 和 PNCompare 这 5 个应用程序的启动命令只有在 PNFILE_PATH 环境变量设置之后与工具安装包 bin 目录下的命令对应上才能生效。用户可以通过以下方式配置 LIC_FILE_PATH 和 PNFILE_PATH 这两个环境变量。1、命令直接配置,在 Linux 或 Unix 系统的客户端直接用设置环境变量的命令 setenv(cshell)、export(bshell)设置。2、创建新的 shell 文件,在工具安装目录下的 shell 文件中设置,如下图 3 所示,pn.cshrc(cshell)或 pn.bshrc(bshell)文件打开更新正确的路径,保存文件之后在 Linux 或 Unix 系统的客户端 source 该文件。3、默认 shell 文件中设置,在 Linux 或 Unix 系统的客户端打开时通常会自动 source 一个隐藏的.cshrc(cshell)或.bshrc(bshell)文件,可以将这两个环境变量设置命令增加到该文件中,这样每次打开客户端时则会自动配置好这两个环境变量。
图 3 PNFile 安装目录下 shell 文件
3、工具启动和调试 PNFile 平台及集成的 PNTree、PNEdit、PNDiff、PNFinder 和 PNCompare 这 5 个应用程序都有单独的命令启动相应的工具界面,应用程序的启动还可以在打开的工具中通过菜单和按钮打开,其对应的按钮为 、 、 、 、 。工具在运行过程出现异常情况时,该平台还支持对出现异常的情况进行调试。
3.1、工具启动方式下图 4 所示为 PNFile 工具的启动命令 pnfile 以及其对应的选项列表,其中”+help/h”选项打印 pnfile 命令支持的所有选项列表、”+version/v”选项打印 PNFile 工具当前使用的版本信息、”+debug”选项打印 PNFile 工具运行过程中出现异常的调试信息、”+proj <proj_name>”选项用来指定 PNFile 工具运行过程中产生的中间文件存放的路径、”+path <path_name>”选项用来指定打开的目录树结构的根节点、”+log <log_file>”选项用来指定 PNFile 工具运行过程中生成的日志文件存放的路径。pnfile 命令缺省启动时会在当前目录下生成 pnfproj 文件夹用于存放中间文件,界面打开的目录树结构的根节点为当前目录路径,日志文件存放于新生成的 pnfproj 文件夹中。
图 4 PNFile 工具启动命令
图 5 PNTree 工具启动命令
图 6 PNEdit 工具启动命令
图 7 PNDiff 工具启动命令
图 8 PNFinder 工具启动命令
图 9 PNCompare 工具启动命令
3.2、异常调试 PNFile 平台及集成的 PNTree、PNEdit、PNDiff、PNFinder 和 PNCompare 这 5 个应用程序都支持对运行过程中异常情况的调试,在命令启动时加上”+debug”选项即可开启异常调试功能。下图 10 所示,PNFile 工具的启动命令 pnfile 加了”+debug”选项,从打印的日志文件中可以看到当在 PNFile 中打开 Directory Print 时出现了异常情况,此时会在日志中打印一段异常报告信息(该段信息有起始关键字”DEBUG begin”和结束关键字”DEBUG end”),对于出现的异常信息用户需要将该日志文件发邮件至邮箱 support@veriforma.com,联系 PNFile 的研发解析该异常出错的原因。
图 10 PNFile 运行异常调试
4、日志文件 PNFile 的运行过程会被记录在一个日志文件中,该日志文件生成的默认路径为当前目录下的"./pnproj/pnfile.log",也可以在 pnfile 命令启动时通过选项”+log <log_file>”选项来指定日志文件存放的路径。在工具操作过程中出现的一些违法操作导致的告警和报错也会被记录在日志文件中,这些告警和报错会有特定名称与之对应。
4.1、日志文件日志文件中记录的信息有软件的名称和版本信息、软件启动时间、工具启动命令及所加选项、license 文件检查结果、运行过程中用户使用的每个操作步骤及时间、操作结果报告(有正常 INFO、告警 W、出错 E 三种操作结果报告类型)、调试信息打印(只有加了”+debug”选项才会打印该信息)。下图 11 所示为 PNFile 工具运行的日志文件示例,PNFile 软件从启动到具体一些操作过程都被依次记录在该文件中。
图 11 PNFile 日志文件
4.2、告警报错信息在 PNFile 的日志文件中记录了违法操作导致的告警和报错信息,其中包含工具名称、告警报错类型、告警报错条目、告警报错简单信息。通常这些信息对于用户检查违法操作和分析出错原因不够充分,下表 1 所示为 PNFile 平台所有会告警和报错的条目和其对应的详细解释以及一些出错的示例,这里根据工具名称分为 PNFile、PNEdit、PNTree、PNDiff、PNFinder、PNCompare 和 Tool 这几项,在每项下列出了当前工具下可能出现的所有告警报错条目名称以及其所对应的详细信息。
告警报错条目 详细解释 PNFileFILEEX Short Message : File exists (add ! to override)Severity : ErrorDescription : You are protected from accidentally overwriting a file. When you want to write anyway, use the same command, but add a "!" right after the command.Example::w /home/test.txtchanges to::w! /home/test.txtNOWRIT Short Message : No write since last change (add ! to override)Severity : ErrorDescription : You are trying to |abandon| a file that has changes. PNEdit protects you from losing your work. You can either write the changed file with ":w", or, if you are sure, |abandon| it anyway, and lose all the changes. This can be done by adding a '!' character right after the command you use.Example::e /home/test.txtchanges to::e! /home/test.txtREADOY Short Message : File access is 'read-only' (add ! to override)Severity : ErrorDescription : You are trying to write a file whose access is read-only. To write the file anyway, add a '!' character right after the command you use.Example::wchanges to::w!CNTWTF Short Message : Can not open the file for writing <write_file>Severity : ErrorDescription : For some reason, the file you are writing to cannot be created or overwritten. The reason could be that you do not have permission to write in the directory or the file name is not valid.CNTACP Short Message : Can not access start path <start_path>Severity : WarningDescription : You may have set the wrong path or do not have the appropriate permission to access the path.PNEditNOWRIT Short Message : No write since last change (add ! to override)Severity : ErrorDescription : You are trying to |abandon| a file that has changes. PNEdit protects you from losing your work. You can either write the changed file with ":w", or, if you are sure, |abandon| it anyway, and lose all the changes. This can be done by adding a '!' character right after the command you use.Example::e /home/test.txtchanges to::e! /home/test.txtCNTOPF Short Message : Can not open file <open_file>Severity : ErrorDescription : If you're getting this error, the problem is most likely that the file name or the path to the file is incorrect.ARGREQ Short Message : Argument requiredSeverity : ErrorDescription : This happens when an Ex command with mandatory argument(s) was executed, but no argument has been specified.READOY Short Message : File access is 'read-only' (add ! to override)Severity : ErrorDescription : You are trying to write a file whose access is read-only. To write the file anyway, add a '!' character right after the command you use.Example::wchanges to::w!FILEEX Short Message : File exists (add ! to override)Severity : ErrorDescription : You are protected from accidentally overwriting a file. When you want to write anyway, use the same command, but add a "!" right after the command.Example::w /home/test.txtchanges to::w! /home/test.txtCNTWTF Short Message : Can not open the file for writing <write_file>Severity : ErrorDescription : For some reason, the file you are writing to cannot be created or overwritten. The reason could be that you do not have permission to write in the directory or the file name is not valid.CNTRDF Short Message : Can not read the file <read_file>Severity : ErrorDescription : PNEdit can not read a temporary file.CNTFDF Short Message : Can not find file <find_file> in pathSeverity : ErrorDescription : The file item you selected can not be found. If you do want to edit a new file, use::e <cfile>CNTACD Short Message : Can not access directory <directory_name>Severity : ErrorDescription : You may have set the wrong directory or do not have the appropriate permission to access the directory.BADRGX Short Message : Bad regular expression: <pattern>Severity : ErrorDescription : Invalid Regular Expression. The pattern you entered is not supported in the current regular expression rules.BADPSP Short Message : Bad Paste position: <position>Severity : ErrorDescription : The line-column position you selected is not valid. You can not paste anything into an invalid position.BADFMP Short Message : Bad From position: <position>Severity : ErrorDescription : The From line-column position you selected is not valid.BADTOP Short Message : Bad To position: <position>Severity : ErrorDescription : The To line-column position you selected is not valid.IVDTAG Short Message : Tag position <position> invalidSeverity : ErrorDescription : The line-column position you selected is not valid. The tag will not be created.PNTreeCNTACP Short Message : Can not access start path <start_path>Severity : WarningDescription : You may have set the wrong path or do not have the appropriate permission to access the path.BADRGX Short Message : Bad regular expression: <pattern>Severity : ErrorDescription : Invalid Regular Expression. The pattern you entered is not supported in the current regular expression rules.BADDIR Short Message : Bad directory: <directory_name>Severity : ErrorDescription : You have selected a directory that either does not exist or you may not have permission to access.CNTEXD Short Message : Can not expand <directory_name>Severity : WarningDescription : Can not expand the directory. This warning could be triggered by one of the following reasons:- The directory has been changed- You have no permissions to access the directoryCNTSHF Short Message : Can not search file <search_file>Severity : WarningDescription : PNTree can not perform search operation in this selected file.CNTRPF Short Message : Can not replace file <replace_file>Severity : WarningDescription : PNTree can not perform replace operation in this selected file.CNTDED Short Message : Can not delete directory <delete_directory>Severity : WarningDescription : The CNTDED warning occurs when users try to delete a directory from their disk. This warning could be triggered by one of the following reasons:- The directory not exist, or its directory name is misspelled- There are files or subdirectories which need higher permissions- There are files in useCNTCPD Short Message : Can not copy directory from <from_directory> to <to_directory>Severity : WarningDescription : The CNTCPD warning message appears when you attempt to copy a file or folder to another directory path. It might come up followed by one of the following messages in different cases:- There is not enough free disk space. Delete one or more files to free disk space, and then try again.- An error occurred while copying the file or folder. The operation timed out.- Can not find the specified directory. Make sure you specify the correct copy to directory name.- The copy to path is write-protected.CNTMVD Short Message : Can not move directory from <from_directory> to <to_directory>Severity : WarningDescription : The CNTMVD warning message appears when you attempt to move a file or folder to another directory path. It might come up followed by one of the following messages in different cases:- There is not enough free disk space. Delete one or more files to free disk space, and then try again.- An error occurred while moving the file or folder. The operation timed out.- Can not find the specified directory. Make sure you specify the correct move to directory name.- The move to path is write-protected.CNTNWD Short Message : Can not new directory <new_directory>Severity : WarningDescription : The CNTNWD warning occurs when users try to create a new file or folder in a directory path. This warning could be triggered by one of the following reasons:- The file or folder already exists- You have no permissions to access the directoryCNTRND Short Message : Can not rename directory <rename_directory> to <new_directory>Severity : WarningDescription : The rename warning message occurs most likely when the directory already exists.CNTCMD Short Message : Can not compress directory <compress_directory> to <compress_file>Severity : WarningDescription : An warning occurs while compressing a directoryCNTDCF Short Message : Can not decompress file <decompress_file> to <decompress_directory>Severity : WarningDescription : An warning occurs while decompressing a directoryPNDiffNOWRIT Short Message : No write since last change (add ! to override)Severity : ErrorDescription : You are trying to |abandon| a file that has changes. PNEdit protects you from losing your work. You can either write the changed file with ":w", or, if you are sure, |abandon| it anyway, and lose all the changes. This can be done by adding a '!' character right after the command you use.Example::e /home/test.txtchanges to::e! /home/test.txtREADOY Short Message : File access is 'read-only' (add ! to override)Severity : ErrorDescription : You are trying to write a file whose access is read-only. To write the file anyway, add a '!' character right after the command you use.Example::wchanges to::w!CNTWTF Short Message : Can not open the file for writing <write_file>Severity : ErrorDescription : For some reason, the file you are writing to cannot be created or overwritten. The reason could be that you do not have permission to write in the directory or the file name is not valid.DIFLIN Short Message : Invalid Diff line customized mode I-NUM valueSeverity : ErrorDescription : The setting of Diff line customized mode I-NUM value is invalid, you need to set a valid I-NUM value.DIFLBN Short Message : Invalid Diff line customized mode B-NUM valueSeverity : ErrorDescription : The setting of Diff line customized mode B-NUM value is invalid, you need to set a valid B-NUM value.DIFCIN Short Message : Invalid Diff column customized mode I-NUM valueSeverity : ErrorDescription : The setting of Diff column customized mode I-NUM value is invalid, you need to set a valid I-NUM value.DIFRGS Short Message : Invalid Diff range line sel mode Start valueSeverity : ErrorDescription : The setting of Diff line sel mode Start value is invalid, you need to set a valid Start value.DIFRGE Short Message : Invalid Diff range line sel mode End valueSeverity : ErrorDescription : The setting of Diff line sel mode End value is invalid, you need to set a valid End value.PNFinderBADDIR Short Message : Bad directory: <directory_name>Severity : ErrorDescription : You have selected a directory that either does not exist or you may not have permission to access.BADRGX Short Message : Bad regular expression: <pattern>Severity : ErrorDescription : Invalid Regular Expression. The pattern you entered is not supported in the current regular expression rules.CNTACP Short Message : Can not access start path <start_path>Severity : WarningDescription : You may have set the wrong path or do not have the appropriate permission to access the path.CNTSHF Short Message : Can not search file <search_file>Severity : WarningDescription : PNTree can not perform search operation in this selected file.CNTRPF Short Message : Can not replace file <replace_file>Severity : WarningDescription : PNTree can not perform replace operation in this selected file.PNCompareBADDIR Short Message : Bad directory: <directory_name>Severity : ErrorDescription : You have selected a directory that either does not exist or you may not have permission to access.MEGIVD Short Message : Can not merge <directory_source> and <directory_target>Severity : ErrorDescription : The MEGIVD warning message appears when you attempt to copy a directory path to another directory path. It might come up followed by one of the following messages in different cases:- There is not enough free disk space. Delete one or more files to free disk space, and then try again.- An error occurred while copying the directory. The operation timed out.- Can not find the specified directory. Make sure you specify the correct copy to directory name.- The copy to path is write-protected.CNTACP Short Message : Can not access start path <start_path>Severity : WarningDescription : You may have set the wrong path or do not have the appropriate permission to access the path.ToolIVDECT Short Message : Can not encrypt file <encrypt_file>Severity : ErrorDescription : You may not have permission to access the file or it has been encrypted before.IVDDCT Short Message : Invalid password <password> to decrypt file <decrypt_file>Severity : ErrorDescription : You have entered an incorrect password. The encrypted file can not be decrypted correctly, please input the right password and try again.SPTLVD Short Message : Split Lines <line_number> is invalidSeverity : ErrorDescription : The number of split line number is invalid, you need to set a valid split line number.SPTFVD Short Message : Split Files <file_number> is invalidSeverity : ErrorDescription : The number of split file number is invalid, you need to set a valid split file number.SPTLRG Short Message : Split add Line-Range <line_range> is invalidSeverity : ErrorDescription : The number of split add line is out of range, you need to set a valid split add line number.SPTPRG Short Message : Split add Part-Range <part_range> is invalidSeverity : ErrorDescription : The number of split add part is out of range, you need to set a valid split add part number.JONRNG Short Message : Join insert Line-Range <line_range> is invalidSeverity : ErrorDescription : The number of join insert line is out of range, you need to set a valid join insert line number.JONFVD Short Message : Join to file <file_name> is invalidSeverity : ErrorDescription : The join to file you provided is invalid, you need to input a valid join to file.BADDIR Short Message : Bad directory: <directory_name>Severity : ErrorDescription : You have selected a directory that either does not exist or you may not have permission to access.CNTPTD Short Message : Can not print directory <print_directory> to <output_file>Severity : ErrorDescription : The CNTPTD error message appears when you attempt to print directory information into an output file. This error could be caused by one of the following reasons:- There is not enough free disk space. Delete one or more files to free disk space, and then try again.- An error occurred while printing a directory information.- You have no permissions to access the printing file or folder 表 1 PNFile 报错信息类型
5、如何获取帮助 5.1、产品信息窗口 PNFile、PNTree、PNEdit、PNDiff、PNFinder 和 PNCompare 的界面 Help 菜单栏中都有一个 About 项,点击该项会打开 PNFile 的产品信息窗口。如下图 12 所示,在该窗口中显示当前使用 PNFile 软件的版本信息、软件版权、产品声明、联系方式等信息。
图 12 PNFile 产品信息窗口
5.2、用户手册浏览器 PNFile 软件的用户手册为 pdf 格式的文档,该文档存放于软件安装目录中的./doc 文件夹下,用户可以通过 PNFile、PNTree、PNEdit、PNDiff、PNFinder 和 PNCompare 的界面 Help 菜单栏中的 User Manual 项、Help 按钮栏中的 图标点击打开用户手册浏览器。如下图 13 所示,该窗口中打开了当前 PNFile 软件版本的用户手册文档,用户可以利用浏览器对文档进行内容内容、页面放大缩小、页跳转和关键字搜索等操作。
图 13 PNFile 用户手册浏览器
5.3、告警报错信息窗口在 PNFile 的日志文件中打印的告警和报错信息,用户可以通过 PNFile 界面 Help 菜单栏中的 Error Message 项点击打开告警报错信息窗口。如下图 14 所示,在该窗口的文本显示区域中分类列出了 PNFile 平台及集成的 PNTree、PNEdit、PNDiff、PNFinder 和 PNCompare 这 5 个应用程序,以及 System Information、Encrypt/Decrypt、Split/Join 和 Directory Print 这 4 个实用工具中所包含的告警和报错信息,用户可以在该窗口中的查询输入框中输入告警报错条目名称可查询各条目的详细信息。
图 14 PNFile 告警报错信息窗口
5.4、文本编辑命令窗口 PNEdit 文本编辑器中有编辑选择、编辑输入、编辑更换、剪切复制粘贴、编辑参数、文件操作、光标移动、文本替换和列模式编辑这 9 种类型的快捷键命令,用户可以通过 PNEdit 界面 Help 菜单栏中的 Command Help 项点击打开文本编辑命令窗口。如下图 15 所示,在该窗口的文本显示区域中分类列出了该文本编辑器中支持的所有快捷命令,用户可以在该窗口中的查询输入框中查询所有快捷命令的详细信息。
图 15 PNFile 文本编辑命令窗口
评论