📄 wy.3wy
字号:
.BI "WyRet sleep(WyTimeSpec " "tm" ")".PP Pause execution of the calling thread for \fItm\fP time period.PP [\fBRet\fP] Ok Wym_EINTR interrupted by a non-blocked signal.PP [\fBRefer\fP] ::nano_sleep(const struct timespec*,struct timespec*).\"--------------------------------------------.PP.BI "WyRet sleep(WyTimeSpec " "req" ", WyTimeSpec& " "rem" ")".PP Pause execution of the calling thread for \fIreq\fP time period If interrupted, \fIrem\fP is set with the remaining time.PP [\fBRet\fP] Ok Wym_EINTR interrupted by a non-blocked signal.PP [\fBRefer\fP] ::nano_sleep(const struct timespec*,struct timespec*).\"--------------------------------------------.PP.BI "WyRet sleep_till(WyTimeSpec " "abstime" ")".PP Pause execution of the calling thread till the system time had passed the given time \fIabstime\fP..PP [\fBRet\fP] Wym_ETIMEDOUT system time had passed \fIabstime\fP Wym_EINTR interrupted by a signal.PP [\fBRefer\fP] ::pthread_cond_timedwait(pthread_cond_t*,pthread_mutex_t* ,const struct timespec*).\"--------------------------------------------.PP.BI "WyTimeSpec now(void)".PP Get the current system time. The system time is a duplicate of UTC's clock. The following are sample codes for current date: WyStr tzstr=... (User supplied time zone string, See \fBlocal_tzname\fP for local time zone name) WyDate date(tzstr,Wy::now());.PP [\fBRet\fP] WyTimeSpec holding the duplicate UTC time.PP [\fBRefer\fP] ::gettimeofday, ::clock_gettime.\"--------------------------------------------.PP.BI "WyRet set_systime(const WyTimeSpec& " "tm" ")".PP Set the system time to \fItm\fP (UTC time).PP [\fBRet\fP] Ok Succeed Wym_EPERM Not permitted (not the superuser) Wym_ERANGE Value overrange ....PP [\fBRefer\fP] ::settimeofday, ::clock_settime.\"--------------------------------------------.PP.BI "WyStr wrd(const WyTimeSpec& tm)".PP Get string representation of \fItm\fP.PP [\fBThrow\fP] WyStr::Reply Wym_ENOMEM Not enough memory.PP [\fBRet\fP] WyStr containing number notation of \fItm\fP in radix 10, e.g. "123.456"..\"--------------------------------------------.PP.BI "WyStr wrd(const WyTimeSpec& " "tm" ", int " "radix" ", size_t " "frdig" ")".PP Get string representation of \fItm\fP in \fIradix\fP representation, \fIfrdig\fP specifies the digits of fration. Note: Function is the same as Wy::_mkstr(WyStr&,const WyTimeSpec&,int,size_t).PP [\fBThrow\fP] WyStr::Reply Wym_EINVAL \fIradix\fP not in valid range Wym_ENOMEM Not enough memory.PP [\fBRet\fP] WyStr number representation .\"--------------------------------------------.PP.BI "WyStr wrd(const WyDate& " "date" ")".PP Get the string representation of \fIdate\fP.PP [\fBThrow\fP] WyStr::Reply Wym_ENOMEM Not enough memory.PP [\fBRet\fP] WyStr of \fIdate\fP in the format: 'Year-Month-Day Hour:Min'Sec"(Wday) TimeZone'. For example, '2004-08-04 03:04'00"(3) UTC'.\"--------------------------------------------.PP.BI "WyRet _strftime(WyStr& " "buf" ", const char* " "format" ", const WyDate& " "date" ")".PP Reset \fIbuf\fP with the string representation of \fIdate\fP according to \fIformat\fP Note: This function is a conversion for ::strftime, refer to the manual for \fIformat\fP..PP [\fBRet\fP] Ok Succeed. Wym_EFBIG string size exceeds the maximum Wym_ENOMEM Not enough memory.PP [\fBRefer\fP] ::strftime(char*,size_t,const char*,const struct tm*).\"--------------------------------------------.PP.BI "WyStr local_tzname(void)".PP Get the local time zone name. Note: Implementation may be slow. In circumstances the time zone setting is known not modified, a wrapper should work (reuse the result): const WyStr& tz_string(void) { static const WyStr tzstr(Wy::local_tzname()); return tzstr; };.PP [\fBThrow\fP] WyDate::Reply Wym_ENOMEM Not enough memory.PP [\fBRet\fP] WyStr of local time zone name, or the name is "UTC" if searching failed.\"--------------------------------------------.PP.BI "WyRet unlink(const WyStr& " "pathname" ")".PP.BI "WyRet unlink(const char* " "pathname" ")".PP Unlink the \fIpathname\fP Note: The \fIpathname\fP is deleted if no other processes is using it. The file it refers to is also deleted if no process is using it..PP [\fBRet\fP] Ok Succeed. \fIpathname\fP unlinked Wym_EACCESS permission denied in the search of \fIpathname\fP Wym_EBUSY \fIpathname\fP is being used Wym_ENAMETOOLONG \fIpathname\fP too long Wym_ENOENT A component in \fIpathname\fP does not exist Wym_ENOTDIR A component in \fIpathname\fP is not a directory Wym_EPERM Operation not permitted Wym_EROFS Refers to a file in a read-only filesystem Wym_EFAULT \fIpathname\fP is inaccessible (const char*) Wym_ENOMEM Not enough memory Wym_ELOOP Too many symbolic encountered Wym_EIO Low level I/O error Wym_EISDIR \fIpathname\fP is a directory (Linux uses this) .... reply converted from ::unlink [\fBRefer\fP] ::unlink(const char*).\"--------------------------------------------.PP.BI "WyRet access(const WyStr& " "pathname" ",int " "mode" ")".PP.BI "WyRet access(const char* " "pathname" ",int " "mode" ")".PP Check whether the calling process has the accessibility \fImode\fP of the \fIpathname\fP mode is a OR'd value of the following constants to check the \fIpathname\fP for: R_OK ... permission of read W_OK ... permission of write X_Ok ... permission of execute F_OK ... existence of the \fIpathname\fP.PP [\fBRet\fP] Ok Succeed. All requested permissions granted Wym_EACCESS Access is not allowed Wym_EBUSY \fIpathname\fP is being used Wym_ENAMETOOLONG \fIpathname\fP too long Wym_ENOENT A component in \fIpathname\fP does not exist Wym_ENOTDIR A component in \fIpathname\fP is not a directory Wym_EPERM Operation not permitted Wym_EROFS Refers to a file in a read-only filesystem Wym_EFAULT \fIpathname\fP is inaccessible (const char*) Wym_ENOMEM Not enough memory Wym_ELOOP Too many symbolic encountered Wym_EIO Low level I/O error Wym_EISDIR \fIpathname\fP is a directory (Linux uses this) Wym_ETXTBSY Write access requested to an executable which is being executed .... reply converted ::access [\fBRefer\fP] ::access(const char*,int).\"--------------------------------------------.PP.BI "WyRet chdir(const WyStr& " "path" ")".PP.BI "WyRet chdir(const char* " "path" ")".PP Change the currenet working directory to \fIpath\fP.PP [\fBRet\fP] Ok Succeed. Wym_EACCESS Access is not allowed Wym_ENAMETOOLONG \fIpath\fP too long Wym_EFAULT \fIpath\fP is inaccessible (const char*) Wym_ENOENT A component in \fIpath\fP does not exist Wym_ENOTDIR A component in \fIpath\fP is not a directory Wym_ENOMEM Not enough memory Wym_ELOOP Too many symbolic encountered Wym_EIO Low level I/O error .... reply converted from the errno ::chdir returned [\fBRefer\fP] ::chdir(const char*).\"--------------------------------------------.PP.BI "WyRet getcwd(WyStr& " "path" ")".PP Reset \fIpath\fP with the currenet working directory (absolute pathname).PP [\fBRet\fP] Ok Succeed. \fIpath\fP is set with the current working directory Wym_EACCESS Access is not allowed Wym_ENOENT The current working directory has been unlinked [\fBRefer\fP] ::getcwd(char*,size_t).\"--------------------------------------------.PP.BI "WyRet chown(const WyStr& " "path" ",uid_t " "owner" ",gid_t " "group" ")".PP.BI "WyRet chown(const char* " "path" ",uid_t " "owner" ",gid_t " "group" ")".PP Change the owner/group of a file.PP [\fBRet\fP] Ok Succeed. Wym_EACCESS Access is not allowed Wym_ENAMETOOLONG \fIpath\fP too long Wym_EFAULT \fIpath\fP is inaccessible (const char*) Wym_ENOENT A component in \fIpath\fP does not exist Wym_ENOTDIR A component in \fIpath\fP is not a directory Wym_EROFS Refers to a file in a read-only filesystem Wym_EPERM Permission denied or \fIowner/group\fP were incorrectly specified Wym_ENOMEM Insufficient kernel memory Wym_ELOOP Too many symbolic links encountered Wym_EIO Low level I/O error [\fBRefer\fP] ::chown(char*,uid_t,gid_t).\"--------------------------------------------.PP.BI "WyRet chmod(const WyStr& " "path" ",mode_t " "mode" ")".PP.BI "WyRet chmod(const char* " "path" ",mode_t " "mode" ")".PP Change file mode. Argument \fImode\fP is bitwise OR values of: S_ISUID set user ID on execution S_ISGID set group ID on execution S_IRUSR allow the owner to read the file S_IWUSR allow the owner to write the file S_IXUSR allow the owner to execute the file S_IRGRP allow the group ID matching the file's group to read S_IWGRP allow the group ID matching the file's group to write S_IXGRP allow the group ID matching the file's group to execute S_IROTH allow others to read the file S_IWOTH allow others to write the file S_IXOTH allow others to execute the file.PP [\fBRet\fP] Ok Succeed. Wym_EACCESS Access is not allowed Wym_ENAMETOOLONG \fIpath\fP too long Wym_EFAULT \fIpath\fP is inaccessible (const char*) Wym_ENOENT A component in \fIpath\fP does not exist Wym_ENOTDIR A component in \fIpath\fP is not a directory Wym_EROFS Refers to a file in a read-only filesystem Wym_EPERM Permission denied or \fIowner/group\fP were incorrectly specified Wym_ENOMEM Insufficient kernel memory Wym_ELOOP Too many symbolic links encountered Wym_EIO Low level I/O error [\fBRefer\fP] ::chmod(const char*,mode_t).\"--------------------------------------------.PP.BI "WyRet link(const WyStr& " "oldpath" ",const WyStr& " "newpath" ")".PP.BI "WyRet link(const char* " "oldpath" ",const char* " "newpath" ")".PP Create a new link (hard link) to an existing file. If \fInewpath\fP exists, it will not be overwritten..PP [\fBRet\fP] Ok Succeed. Wym_EFAULT \fIoldpath\fP or \fInewpath\fP is inaccessible (const char* version) Wym_EXDEV \fIoldpath\fP and \fInewpath\fP are not on the same filesystem Wym_EPERM Operation not permitted Wym_EACCESS Access is not allowed Wym_ENAMETOOLONG \fInewpath\fP or \fIoldpath\fP too long Wym_ENOENT Components in the pathnames do not exist Wym_ENOTDIR Components in the pathnames are not directory Wym_ENOMEM Not enough memory Wym_EROFS Refers to a file in a read-only filesystem Wym_EEXIST \fInewpath\fP already exist Wym_EMLINK \fIoldpath\fP already has the maximum number of links to it Wym_ELOOP Too many symbolic encountered Wym_ENOSPC No space left for the pathname. Wym_EIO I/O error .... reply converted from ::link [\fBRefer\fP] ::link(const char*,const char*).\"--------------------------------------------.PP.BI "WyStr wrd(const Wy_ThreadID& " "tid" ")".PP.BI "WyStr wrd(const WyReply& " "em" ") throw(WyStr::Reply)".PP.BI "WyStr wrd(const WyRet& " "em" ") throw(WyStr::Reply)".PP.BI "WyStr wrd(const Wy_SrcLoc& " "s" ") throw(WyStr::Reply)".PP Get string representation of the given argument object.PP [\fBThrow\fP] WyStr::Reply Wym_ENOMEM Not enough memory.PP [\fBRet\fP] WyStr, string representation of the argument object.\"--------------------------------------------.PP.BI "WyStr Wy::wrd(NumType " "num" ", int " "radix" "=10)".PP Convert \fInum\fP to text string in \fIradix\fP notation Note: Function is the same as Wy::_mkstr(WyStr&,NumType,int).PP [\fBThrow\fP] WyStr::Reply Wym_EINVAL \fIradix\fP not in valid range [0,2-36] Wym_ENOMEM Not enough memory.PP [\fBRet\fP] WyStr number representation of the conversion.\"--------------------------------------------.PP.BI "WyStr Wy::wrd(NumType " "num" ", int " "radix" ", size_t " "frdig" ")".PP Convert \fInum\fP to text string in \fIradix\fP notation. \fIfrdig\fP specifies the digits of fraction. Note: Function is the same as Wy::_mkstr(WyStr&,NumType,int,size_t) Example for fraction roundup: float num( SomePositiveNumber );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -