摘要:
1.当文件有hole时,cp命令会同时拷贝这些hole为'\0'。这里是一个实现了拷贝时跳过文件hole的程序。ps:我用的buffer是一个字节的,效率很低,但如果用大的buffer就会使得hole被移除,使得原先分开的字符被连上。我没想好如何解决这个问题。如果您知道,请您告诉小弟我,非常感谢!View Code#include <apue.h>#include <my_error.h>#include <fcntl.h>int main(){ char buf[1]; int fd,fd_to; int n; if( (fd=open(& 阅读全文
posted @ 2012-12-09 16:42
梓涵VV
阅读(249)
评论(0)
推荐(0)
摘要:
1. 控件位置的确定控件的位置一般来说是相对其父的其左上角的坐标:QWidget *w = new QWidget(this);QPoint p = w->pos();int x = p.x();int y = p.y();若要得到其针对全局界面的坐标值,则需要转换一下,用mapToGlobal():QPoint p(0, 0);int x = mapToGlobal(p).x();int y = mapToGlobal(p).y();2. QWidget(1) 对widget的显示和隐藏QWidget *w = new QWidget(this);w->setHidden(tru 阅读全文
posted @ 2012-12-09 16:35
梓涵VV
阅读(1730)
评论(0)
推荐(0)

浙公网安备 33010602011771号