- 博客(7)
- 资源 (5)
- 收藏
- 关注
原创 bash方便的条件语句(转载)
方便的条件语句如果您曾用 C 编写过与文件相关的代码,则应该知道:要比较特定文件是否比另一个文件新需要大量工作。那是因为 C 没有任何内置语法来进行这种比较,必须使用两个 stat() 调用和两个 stat 结构来进行手工比较。相反,bash 内置了标准文件比较运算符,因此,确定“/tmp/myfile 是否可读”与查看“$myvar 是否大于 4”一样容易。下表列出最常用的 bash 比
2008-07-24 09:13:00 605
转载 (转载)LINUX动态链接库高级应用
在《Linux下动态链接库的创建与应用》一文中,我介绍了LINUX动态链接库的基本知识.其要点是:用户根据实际情况需要,利用dlopen,dlsym,dlclose等动态链接库操作函数,装入指定的动态链接库中指定的函数,然后加以执行.程序中使用很少的动态函数时,这样的做法尚可.如果程序需要调用大量的动态函数,那么采用这样的编程手段将是非常繁复的,所以我们必须使用一种更为聪明的办法,以减少代码量,提
2008-06-11 11:13:00 355
原创 linux杂记
1) 从shell里面查看前一次程序执行的返回值($?): % echo $?。 例如,前一次调用成功,这个echo命令将返回0——linux下成功时返回0。2) stdout带缓存,所以printf不一定立马打出,但是stderr是不带缓存的
2008-01-31 21:16:00 237
原创 linux下生成临时文件两个方法
载自"Advanced Linux Programming" By Mark Mitchell, Jeffrey Oldham, Alex Samuel. 有两种方法:1)使用 mkstemp。使用该函数时文件名需要有个以六个X结尾的命名模板,例如char temp_filename[] = "/tmp/temp_file.XXXXXX"。 使用这个方法,临时文件不会自动删除。可以调用un
2008-01-31 21:13:00 1037
原创 解决Virtual Pc下Linux花屏(屏幕显示不正常)问题(zt)
用一些老版本,如RedHat Linux9.0的朋友可以参考下。 网上资料很多,但有的对有的不对,有的详细有的少了看似简单的步骤,偶解决完这个问题赶紧写下来,一是为以后怕忘了,二是也各大家作个参考,少走我的弯路。这个显现产生的原因就是VirtualPc默认的显卡和安装的Linux的显示位数不符造成的。 解决它的方法其实就是修改我们在VPC上安装好的Linux的/etc/X11/XF86Conf
2007-03-29 19:30:00 2331 1
转载 读书笔记: 局域网中实现多播(zt)
读书笔记: 局域网中实现多播 最近一直在看>这本书,觉得这本书很适合初学socket编程的人(比如说我自己 ^_^ )。我一直对于多播的实现比较模糊,在看了书上的多播部分的介绍,才发现在程序中实现一个基本的多播功能是如此简单。在这里我不想照本宣科的大说什么理论,概念的东东,我的目的是说明在我们的代码中如何实现多播功能。开发环境: VC 6.0(sp5), 使用winsock2(ws2_32.li
2007-02-27 14:52:00 772
原创 IP头格式口诀
IP头格式口诀:版头类全分组三,存活协议checksum,源目选项占的宽。 IP头最少占20bytes----------------------------------------------------------------------------------------------------------------------------------------
2007-02-13 22:01:00 883
Programming For The Java Virtual Machine
2009-05-04
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人