📄 wy_lnkfile.3wy
字号:
.\".\" Edited by I.J.Wang, 2004.\".TH Wy_LnkFile 3wy "libwy v0.31".SH NAMEWy_LnkFile \- handle class of system link file.SH SYNOPSIS.B #include <wy_lnkfile.h>.PP[\fBInherit\fP].PPWy_LnkFile is a handle class for the system link fileNote: Implementation pretends a file descriptor was allocated, which is not true. The referred system link file may have been unlinked or modified while the object is in use..SH "PUBLIC MEMBERS" class \fBReply\fP : public WyRet \fBWy_LnkFile\fP() \fBWy_LnkFile\fP(const Wy_LnkFile&) \fBWy_LnkFile\fP(const char*) \fBWy_LnkFile\fP(const WyStr&) \fBWy_LnkFile\fP(Wy_LnkFile&, Wy::ByMove_t) throw() virtual \fB~Wy_LnkFile\fP() bool \fBis_default\fP(void) const throw() WyRet \fBstat\fP(WyFileStat&) const virtual WyRet \fBreset\fP(void) virtual WyRet \fBreset\fP(const Wy_LnkFile&) virtual WyRet \fBreset\fP(const char*) virtual WyRet \fBreset\fP(const WyStr&) virtual WyRet \fB_swap\fP(Wy_LnkFile&) throw() virtual Wy_LnkFile* \fB_alloc\fP(WyRet&) const virtual WyRet \fBread\fP(WyStr&) static WyRet \fBcreate\fP(const char*,const char*) static WyRet \fBcreate\fP(const char*,const WyStr&) static WyRet \fBcreate\fP(const WyStr&,const char*) static WyRet \fBcreate\fP(const WyStr&,const WyStr&).SH "DESCRIPTION".\"--------------------------------------------.PP.BI "class Reply : public WyRet.PP Class specific throw type.\"--------------------------------------------.PP.BI "Wy_LnkFile()".PP Construct default object (refers to nothing).PP [\fBThrow\fP] Reply Wym_ENOMEM Not enough memory.\"--------------------------------------------.PP.BI "Wy_LnkFile(const Wy_LnkFile& " "lnkf" ")".PP Construct object to handle the system file handled by \fIlnkf\fP..PP [\fBThrow\fP] Reply Wym_ENOMEM Not enough memory.\"--------------------------------------------.PP.BI "Wy_LnkFile(const char* " "pathname" ")".PP.BI "Wy_LnkFile(const WyStr& " "pathname" ")".PP Construct object to handle the system file pointed by \fIpathname\fP.PP [\fBThrow\fP] Reply Wym_ENODEV \fIpathname\fP does not refer to a link Wym_EBADF File is not valid for the operation Wym_EACCES Search permission is denied Wym_ELOOP Too many symbolic links encountered Wym_ENAMETOOLONG Pathname too long Wym_ENOENT Pathname does not exist Wym_ENOTDIR Entry in pathname is not a directory Wym_EIO I/O error Wym_EFAULT \fIpathname\fP is inaccessible Wym_ENOMEM Not enough memory ... [reserved].PP [\fBRefer\fP] ::lstat(const char*,struct stat*).\"--------------------------------------------.PP.BI "Wy_LnkFile(Wy_LnkFile& " "src" ", Wy::ByMove_t) throw()".PP See Wy_Array(Wy_Array&, Wy::ByMove_t) in wy_array(3wy) for definition of the move constructor..\"--------------------------------------------.PP.BI "virtual ~Wy_LnkFile()".PP Destruct *this.PP Note: This member is non-cancellable..\"--------------------------------------------.PP.BI "bool is_default(void) const throw()".TP Is *this equivalent to the default object.PP [\fBRet\fP] true= object is equivalent to the default one. false= otherwise.\"--------------------------------------------.PP.BI "WyRet stat(WyFileStat& " "filestat" ") const" .PP Reset \fIfilestat\fP with the file information *this associates Note: The link itself is reffered, not the linked file..PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is default Wym_ENOMEM Not enough memory ... reply converted from ::lstat returned.PP [\fBRefer\fP] ::lstat(int,struct stat).\"--------------------------------------------.PP.BI "virtual WyRet reset(void)" .PP Reconstruct *this to the state as Wy_LnkFile().PP [\fBRet\fP] Ok Succeed. ... Note: Object is always default while returned..\"--------------------------------------------.PP.BI "virtual WyRet reset(const Wy_LnkFile& " "lnkf" ")" .PP Reconstruct *this to the state as Wy_LnkFile(\fIlnkf\fP).PP [\fBRet\fP] Ok Succeed. Wym_ENOMEM Not enough memory ... [reserved] Note: Error report from closing the previously handled object is ignored. Use reset() first if the close return status is desired.\"--------------------------------------------.PP.BI "virtual WyRet reset(const char* " "pathname" ")" .PP.BI "virtual WyRet reset(const WyStr& " "pathname" ")" .PP Reconstruct *this to the state as Wy_LnkFile(\fIpathname\fP).PP [\fBRet\fP] Ok Succeed. Wym_ENODEV \fIpathname\fP does not refer to a link Wym_EBADF File is not valid for the operation Wym_EACCES Search permission is denied Wym_ELOOP Too many symbolic links encountered Wym_ENAMETOOLONG Pathname too long Wym_ENOENT Pathname does not exist Wym_ENOTDIR A component in pathname is not a directory Wym_EIO I/O error Wym_ENOMEM Not enough memory ... [reserved] Note: Error report from closing the previously handled object is ignored. Use reset() first if the close return status is desired.PP [\fBRefer\fP] ::lstat.\"--------------------------------------------.PP.BI "virtual WyRet _swap(Wy_LnkFile& " "lnkf" ") throw()".PP Interchange state of *this with \fIlnkf\fP.PP [\fBRet\fP] Ok Succeed Wym_EBADTYPE \fIlnkf\fP is not the same type.\"--------------------------------------------.PP.BI "virtual Wy_LnkFile* _alloc(WyRet& " "r" ") const".PP Allocate a default object of the most inherited type that *this refers. Note: Inhertied class must override this member \fIr\fP is reset with the return status: Wym_ENOMEM Not enough memory ... Same from constructing Wy_LnkFile().PP [\fBRet\fP] Pointer of the allocated object, or NULL if failed. User is responsible to \fBdelete\fP the returned object..\"--------------------------------------------.PP.BI "virtual WyRet read(WyStr& " "value" ")" .PP Read the value of the link object and reset \fIvalue\fP with the result..PP Note: Implementation pretends a file descriptor was allocated, which is not true. The referred system link file may have been unlinked..PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is default Wym_ENOMEM Not enough memory ..... reply converted from ::readlink.PP [\fBRefer\fP] ::readlink.\"--------------------------------------------.PP.BI "static WyRet create(const char* " "oldpath" ",const char* " "newpath" ")".PP.BI "static WyRet create(const char* " "oldpath" ",const WyStr& " "newpath" ")".PP.BI "static WyRet create(const WyStr& " "oldpath" ",const char* " "newpath" ")".PP.BI "static WyRet create(const WyStr& " "oldpath" ",const WyStr& " "newpath" ")".PP Create a symbolic link file \fInewpath\fP which contains the value \fInewpath\fP..PP [\fBRet\fP] Ok Succeed. Wym_EACCESS Access is not allowed Wym_EPERM Operation not permitted Wym_ENAMETOOLONG \fInewpath\fP or \fIoldpath\fP too long Wym_ENOENT A component in the pathnames does not exist Wym_ENOTDIR A component in the pathnames is not a directory Wym_ENOMEM Not enough memory Wym_EROFS Refers to a file in a read-only filesystem Wym_EEXIST \fInewpath\fP already exist Wym_ELOOP Too many symbolic encountered Wym_ENOSPC No space left for the pathname. Wym_EIO I/O error .... reply converted from the errno ::symlink [\fBRefer\fP] ::symlink(const char*,const char*).\"--------------------------------------------.SH "SEE ALSO".BR wyfilestat.BR wychrfile.BR wy_dirfile.BR wy.BR wystr.BR wymutex.BR wytimespec.SH NOTEExcept added by this library, replys are converted from the errno an underlying C library function returned. Report of such replysare brief from Linux Programmer's Manual. See the associated man pagefor details.Project is in development, http://sourceforge.net/projects/libwx
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -