PHP上传文件1:上传文件的三步骤:
(1):$_FILES("upload");//upload:他是一个二维数组 (2):判断是否有文件上传:$_upload(File)
(3):将文件上传到服务器:move_uploaded_file();2:if(is_uploaded_fil...
分类:
Web程序 时间:
2014-05-14 02:57:10
阅读次数:
389
public String BufferedReaderDemo(String path)
throws IOException...{File file=new
File(path);if(!file.exists()||file.isDirectory())throw new FileNotFo...
分类:
其他好文 时间:
2014-05-14 02:16:11
阅读次数:
199
#include
#include
using namespace std;
#ifdef ONLINE_JUDGE
#define FINPUT(file) 0
#define FOUTPUT(file) 0
#else ...
分类:
其他好文 时间:
2014-05-13 23:42:33
阅读次数:
316
这道题的思路还是比较清晰的,用栈嘛,麻烦是麻烦在这些层次的细节上。主要有下面几个:
./和/:当前路径,遇到这种,应该将后面的文件夹或文件入栈。
../:上一层路径,遇到这种,应该做一次出栈操作,相当于返回了上一层目录。
//:可以直接简化成‘/’。
还有下面几个要注意的测试用例:
1. linux的路径名可以含有很多特殊字符,比如“_”,".","*"等等,所以要特别注意含有"."的哪...
分类:
其他好文 时间:
2014-05-13 23:32:13
阅读次数:
347
查询当前运行进程中是否有指定进程有多种方式,下面介绍一种通过进程名获取进程号,以此来确认该进程是否在运行。
如下实例,查询当前运行进程中是否有test进程在运行。
char buf[200]={0};
system("ps -A | awk '/test/{print $1}'>result");
FILE *fd;
fd=popen...
分类:
系统相关 时间:
2014-05-13 08:02:55
阅读次数:
409
#!/usr/bin/envpythonimportsys,timefromsocketimportsocketdefread_interface(in_file):withfile(in_file)asf:returnf.readlines()[2:]defset_interface(inter_msg):dic={}foriinxrange(len(inter_msg)):dic[inter_msg[i].split(":")[0].strip()]={"in":inter_msg[i].split(":..
分类:
编程语言 时间:
2014-05-13 04:01:55
阅读次数:
432
#!/usr/bin/envpython#coding:utf8#此脚本为查找递归目录下所有文件匹配的内容importos,sys,tabdefpaths(path):list_path=os.walk(path)all_file=[]forp,d,flinlist_path:forfinfl:pfile=os.path.join(p,f)ifos.path.isdir(pfile):paths(pfile)all_file.append(pfile)returnall..
分类:
编程语言 时间:
2014-05-13 03:49:34
阅读次数:
426
#!/usr/bin/envpython#coding:utf8importos,sys,glob,time,MySQLdb,reDIRNAME=os.path.dirname(__file__)OPSTOOLS_DIR=os.path.abspath(os.path.join(DIRNAME,‘..‘))sys.path.append(OPSTOOLS_DIR)fromlibrary.mysqlconfigimportMySQLDConfig,getMyVariablesfromoptparseimport..
分类:
数据库 时间:
2014-05-13 02:46:59
阅读次数:
809
#!/usr/bin/envpython#coding:utf8importos,sysimportdatetime,shutil,subprocessfromconfig.configimportslow_configclasscut_mysql(object):mysql_user,mysql_pass,date_day,slow_log_name,slow_log_path,mysqlsla_log_name,mysqldumpslow_log_name,new_log_path,new_log_nam..
分类:
数据库 时间:
2014-05-13 02:39:47
阅读次数:
482
#!/usr/bin/envpython#coding:utf8importos,sysimportmd5,tabfrommysql_co.my_dbimportset_mysqlfromssh_co.ssh_connectimportsshdfromssh_co.cfg.configimportssh_message,item_pathfromfileimportfindfiledefmy_mysql():db_file={}my_connect=set_mysql()f_file=findfile.mai..
分类:
编程语言 时间:
2014-05-13 01:44:22
阅读次数:
449