Linux fopen函数 stat函数
1.
今天上班追了个问题,追了半天发现是fopen打开大于2G的文件有问题。
马上Google下,做个笔记:
// 定义宏,使得可以处理大文件(>4GB)
#undef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#include <unistd.h>
#include <dirent.h>
fopen64()
2.
函数:perror
NAME
perror - print a system error message
SYNOPSIS
#include <stdio.h>
void perror(const char *s);
#include <errno.h>
const char *sys_errlist[];
int sys_nerr;
int errno;
相关文档:
例一:发送Signaling Packet:
Signaling Command是2个Bluetooth实体之间的L2CAP层命令传输。所以得Signaling Command使用CID 0x0001.
多个Command可以在一个C-frame(control frame)中发送。
如果要直接发送Signaling Command.需要建立SOCK_RAW类型的L2CAP连接Socket。这样才有机会自己填充Command Code,Identi ......
Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......
1.管道
1.1普通管道
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
int main()
{
int pipe_fd[2];
pid_t pid;
  ......
作者:Sam(甄峰) sam_cdoe@hotmail.com
1.创建thread.
int pthread_create(pthread_t *restrict thread, const pthread_attr_t *restrict attr,
void *(*start_routine)(void*), void *restrict arg);
参数1:pthread_t *restrict t ......
linux 打包命令tar:
tar cvf my.tar file1 // 单个文件
tar cvf my.tar file1 file2 .. // 多个文件
tar cvf my.tar dir1 // 单个目录
tar cvf my.tar dir1 dir2 .. // 多个目录
以上仅打包并无压缩。
参数:
-c :建立一个压缩文件的参数指令(create 的意思);
-x :解开一个压缩文件的参数指令!
- ......