- 博客(12)
- 收藏
- 关注
原创 VirtualBox添加共享文件夹
直接上图添加了一个名为"Ubuntu10.04-en"的共享文件夹但是按照它说的命令 mount -t vboxsf share mount_point打入,然后悲剧了错误 "/sbin/mount.vboxsf: mounting failed with the error: Protocol error"后来才发现,上图中的命令中的share改为共享文件夹的
2014-02-08 23:12:07
735
原创 Kill命令模拟1
先贴代码#include#include#include#include#includeint main(int argc,char* argv[]){ pid_t pid_id=0; char* pid; if(argc!=2) { fprintf(stderr,"Usage: kill pid \n"); exit(1); } pid=argv[1];
2014-01-28 22:11:41
776
原创 C语言-getopt函数
函数原型:#includeint getopt(int argc,char *const argv[],const char *optstring);extern char *optarg;extern int optind,opterr,optopt;optstring为一个字符列表,每个字符代表一个单字符选项全局变量:optarg:存数据optindopterr:控制
2013-11-20 21:51:12
1164
转载 struct stat结构体中st_mode参数的含义
stat 结构体重 st_mode 参数的含义关于st_mode参数的定义:由于在文件系统编程中经常会用到这个结构,网上很多含糊其辞,下面是我在网上搜索的,整理如下,如果可以的话,应该去源码下搜索一下st_mode 应该是一个32为的整形变量,现在的linux系统只用了其中的前16位(0-15) 第15位:其实这一位只用到了一次: 0170000 (和12-1
2013-11-20 10:40:06
3833
原创 模仿linux命令ls
最近学linux下C编程,学到文件方面,编写了一个模仿命令ls的C语言程序,先贴代码#include#include#include#include#include#include#include#includevoid printmode(mode_t modes){ int i=0; char descrip[11]; static short octarray[9
2013-11-20 10:37:28
1740
转载 小红伞Rescue System-USB
Booting Avira Rescue System from a USB Stick.Avira offers the product Avira Rescue System, which can be used to start, scan and repair a computer.The product needs to be downloaded and burned
2013-11-18 23:39:13
1517
原创 VirtualBox安装增强功能(CentOS6.3)
VirtualBox安装CentOS6.3有一段时间了,但是迟迟没有装上增强功能,折腾一会,装上了,过程还是挺曲折的。首先要虚拟机加载下那个安装镜像文件就是那个VBoxGuestAdditions.iso文件,这个文件放在VirtualBox的安装目录下(刚开始在没加载iso镜像文件下直接在系统mount光盘,老是挂载不了,搞了很久才发现没加载镜像文件,囧),OK,加载好后,在终端
2013-11-18 15:09:31
1137
转载 scanf格式化字符串详解
scanf格式控制的完整格式: % * m l或h 格式字符 ①格式字符与printf函数中的使用方式相同,以%d、%o、%x、%c、%s、%f、%e,无%u格式、%g格式。 ②可以指定输入数据所占列宽,系统自动按它截取所需数据。如: scanf( "%3d%3d", &a, &b); 输入:123456 系统自动将123
2013-11-12 19:44:00
1161
原创 C语言-fgets()篇2
前面写过一篇fgets()从键盘获取数据然后输出到屏幕上,现在用fgets()来将从键盘获得数据然后写入到文件当中,先贴代码。#include#include#include#define MaxSize 20#define true 1void main(){ char *proverbs[]= { "Many a mickle makes a muckle.\n",
2013-11-11 22:42:03
1197
原创 C学习-fgets()篇1
学习fgets()函数时发现了一个问题,先贴代码#include#include#includevoid convert(char buffer[]) //将字符转换大写{ int i; for(i=0;buffer[i]!='\0';i++) { buffer[i]=toupper(buffer[i]); }}int findstring() /* Findin
2013-11-10 16:06:43
925
原创 php在线编辑文件网页
初学php,做了一个简单的在线编辑文件网页编辑界面<?phpfunction read(){ readfile("test.php");}?><?php read();?> 很简单,目前只是编辑某个特定文件处理界面<?php$text=stripslashes($_POST['edit']);file_put_cont
2013-11-02 08:33:26
2378
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人