⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resource.n

📁 linux系统下的音频通信
💻 N
字号:
'\"'\" Copyright (c) 1997 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" SCCS: @(#) resource.n 1.4 97/09/10 15:22:18'\" .so man.macros.TH resource n 8.0 Tcl "Tcl Built-In Commands".BS'\" Note:  do not modify the .SH NAME line immediately below!.SH NAMEresource \- Manipulate Macintosh resources.SH SYNOPSIS\fBresource \fIoption\fR ?\fIarg arg ...\fR?.BE.SH DESCRIPTION.PPThe \fBresource\fR command provides some generic operations fordealing with Macintosh resources.  This command is only supported onthe Macintosh platform.  Each Macintosh file consists of two\fIforks\fR: a \fIdata\fR fork and a \fIresource\fR fork.  You use thenormal open, puts, close, etc. commands to manipulate the data fork.You must use this command, however, to interact with the resourcefork.  \fIOption\fR indicates what resource command to perform.  Anyunique abbreviation for \fIoption\fR is acceptable.  The valid optionsare:.TP\fBresource close \fIrsrcRef\fRCloses the given resource reference (obtained from \fBresourceopen\fR).  Resources from that resource file will no longer beavailable..TP\fBresource delete\fR ?\fIoptions\fR? \fIresourceType\fRThis command will delete the resource specified by \fIoptions\fR andtype \fIresourceType\fR (see RESOURCE TYPES below).  The optionsgive you several ways to specify the resource to be deleted..RS.TP\fB\-id\fR \fIresourceId\fRIf the \fB-id\fR option is given the id \fIresourceId\fR (see RESOURCEIDS below) is used to specify the resource to be deleted.  The id must be a number - to specify a name use the \fB\-name\fR option..TP\fB\-name\fR \fIresourceName\fRIf \fB-name\fR is specified, the resource named\fIresourceName\fR will be deleted.  If the \fB-id\fR is alsoprovided, then there must be a resource with BOTH this name andthis id.  If no name is provided, then the id will be used regardlessof the name of the actual resource..TP\fB\-file\fR \fIresourceRef\fRIf the \fB-file\fR option is specified then the resource will bedeleted from the file pointed to by \fIresourceRef\fR.  Otherwise thefirst resource with the given \fIresourceName\fR and or\fIresourceId\fR which is found on the resource file path will be deleted.  To inspect the file path, use the \fIresource files\fB command..RE.TP\fBresource files ?\fIresourceRef\fR?If \fIresourceRef\fRis not provided, this command returns a Tcl listof the resource references for all the currently open resource files.The list is in the normal Macintosh search order for resources.  If \fIresourceRef\fR is specified, the command willreturn the path to the file whose resource fork is represented by thattoken..TP\fBresource list \fIresourceType\fR ?\fIresourceRef\fR?List all of the resources ids of type \fIresourceType\fR (see RESOURCETYPES below).  If \fIresourceRef\fR is specified then the command willlimit the search to that particular resource file.  Otherwise, allresource files currently opened by the application will be searched.A Tcl list of either the resource name's or resource id's of the foundresources will be returned.  See the RESOURCE IDS section below formore details about what a resource id is..TP\fBresource open \fIfileName\fR ?\fIpermissions\fR?Open the resource for the file \fIfileName\fR.  Standard filepermissions may also be specified (see the manual entry for \fBopen\fRfor details).  A resource reference (\fIresourceRef\fR) is returnedthat can be used by the other resource commands.  An error can occurif the file doesn't exist or the file does not have a resource fork.However, if you open the file with write permissions the file and/orresource fork will be created instead of generating an error..TP\fBresource read \fIresourceType\fR \fIresourceId\fR ?\fIresourceRef\fR?Read the entire resource of type \fIresourceType\fR (see RESOURCETYPES below) and the name or id of \fIresourceId\fR (see RESOURCE IDSbelow) into memory and return the result.  If \fIresourceRef\fR isspecified we limit our search to that resource file, otherwise wesearch all open resource forks in the application.  It is important tonote that most Macintosh resource use a binary format and the datareturned from this command may have embedded NULLs or other non-ASCIIdata..TP\fBresource types ?\fIresourceRef\fR?This command returns a Tcl list of all resource types (see RESOURCETYPES below) found in the resource file pointed to by\fIresourceRef\fR.  If \fIresourceRef\fR is not specified it willreturn all the resource types found in every resource file currentlyopened by the application..TP\fBresource write\fR ?\fIoptions\fR? \fIresourceType\fR \fIdata\fRThis command will write the passed in \fIdata\fR as a new resource oftype \fIresourceType\fR (see RESOURCE TYPES below).  Several optionsare available that describe where and how the resource is stored..RS.TP\fB\-id\fR \fIresourceId\fRIf the \fB-id\fR option is given the id \fIresourceId\fR (see RESOURCEIDS below) is used for the new resource, otherwise a unique id will begenerated that will not conflict with any existing resource.  However,the id must be a number - to specify a name use the \fB\-name\fR option..TP\fB\-name\fR \fIresourceName\fRIf \fB-name\fR is specified the resource will be named\fIresourceName\fR, otherwise it will have the empty string as thename..TP\fB\-file\fR \fIresourceRef\fRIf the \fB-file\fR option is specified then the resource will bewritten in the file pointed to by \fIresourceRef\fR, otherwise themost resently open resource will be used..TP\fB\-force\fRIf the target resource already exists, then by default Tcl will notoverwrite it, but raise an error instead.  Use the -force flag toforce overwriting the extant resource..RE.SH "RESOURCE TYPES"Resource types are defined as a four character string that is thenmapped to an underlying id.  For example, \fBTEXT\fR refers to theMacintosh resource type for text.  The type \fBSTR#\fR is a list ofcounted strings.  All Macintosh resources must be of some type.  SeeMacintosh documentation for a more complete list of resource typesthat are commonly used..SH "RESOURCE IDS"For this command the notion of a resource id actually refers to twoideas in Macintosh resources.  Every place you can use a resource Idyou can use either the resource name or a resource number.  Names arealways searched or returned in preference to numbers.  For example,the \fBresource list\fR command will return names if they exist ornumbers if the name is NULL..SH "SEE ALSO"open.SH "PORTABILITY ISSUES"The resource command is only available on Macintosh..SH KEYWORDSopen, resource

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -