errno

openresty(nginx)、lua、drizzle调研

白昼怎懂夜的黑 提交于 2019-11-26 14:50:05
一、概述: 1.研究目标:nginx中使用lua脚本,及nginx直接访问mysql,redis 2.需要安装的内容: openresty,mysql,redis 3.OpenResty (也称为 ngx_openresty)是一个全功能的 Web 应用服务器。它打包了标准的 Nginx 核心,很多的常用的第三方模块,以及它们的大多数依赖项。 http://openresty.org/cn/index.html 二、安装说明 0.环境准备 $yum install -y gcc gcc-c++ readline-devel pcre-devel openssl-devel tcl perl 1、安装drizzle http://wiki.nginx.org/HttpDrizzleModule cd /usr/local/src/ wget http://openresty.org/download/drizzle7-2011.07.21.tar.gz tar xzvf drizzle7-2011.07.21.tar.gz cd drizzle7-2011.07.21/ ./configure --without-server make libdrizzle-1.0 make install-libdrizzle-1.0 export LD_LIBRARY_PATH=/usr

Python [Errno 98] Address already in use

不羁岁月 提交于 2019-11-26 12:18:07
问题 In my Python socket program, I sometimes need to interrupt it with Ctrl-C . When I do this, it does close the connection using socket.close() . However, when I try to reopen it I have to wait what seems like a minute before I can connect again. How does one correctly close a socket? Or is this intended? 回答1: Yes, it is intended. Here you can read detailed explanation. It is possible to override this behavior by setting SO_REUSEADDR option on a socket. For example: sock.setsockopt(socket.SOL

How to know what the 'errno' means?

最后都变了- 提交于 2019-11-26 11:32:59
When calling execl(...) , I get an errno=2 . What does it mean? How can I know the meaning of this errno ? You can use strerror() to get a human-readable string for the error number. This is the same string printed by perror() but it's useful if you're formatting the error message for something other than standard error output. For example: #include <errno.h> #include <string.h> /* ... */ if(read(fd, buf, 1)==-1) { printf("Oh dear, something went wrong with read()! %s\n", strerror(errno)); } Linux also supports the explicitly-threadsafe variant strerror_r() . Instead of running perror on any

How to create a file in Ruby

陌路散爱 提交于 2019-11-26 08:45:21
问题 I\'m trying to create a new file and things don\'t seem to be working as I expect them too. Here\'s what I\'ve tried: File.new \"out.txt\" File.open \"out.txt\" File.new \"out.txt\",\"w\" File.open \"out.txt\",\"w\" According to everything I\'ve read online all of those should work but every single one of them gives me this: ERRNO::ENOENT: No such file or directory - out.txt This happens from IRB as well as a ruby file. What am I missing? 回答1: Use: File.open("out.txt", [your-option-string]) {

How to know what the &#39;errno&#39; means?

北慕城南 提交于 2019-11-26 03:26:22
问题 When calling execl(...) , I get an errno=2 . What does it mean? How can I know the meaning of this errno ? 回答1: You can use strerror() to get a human-readable string for the error number. This is the same string printed by perror() but it's useful if you're formatting the error message for something other than standard error output. For example: #include <errno.h> #include <string.h> /* ... */ if(read(fd, buf, 1)==-1) { printf("Oh dear, something went wrong with read()! %s\n", strerror(errno)