|
/*ASD组件1:本机文件浏览器(已经添加文件操作部分)*/
#include<stdio.h>
#define X 80
#define Y 22
#define Z 500000
#define P 500
main()
{
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//定义部分
///小文件文件名开始的地方
int N;
///当前“窗口”
char Form;
///语言
char L;
///显示
char a[Y][X];
///用来填充“AFM”的内容
char ash[Z];
///Form1显示模式
char M;
///ash[]刷新控制
int fre;
///初始路径
char path1[P]="/root/";
///扩展路径
char path2[P];
///文件序号
int num;
///页码
int page;
///页码上限
int pgmx;
///临时文件
FILE *als;//列表
//FILE *arp;//修正
//FILE *dbg;//监视ash[];
///列表命令
char ls1[50]="/bin/ls -Al \"?\">\"/tmp/asd/als.txt\"";
char ls2[50]="/bin/ls -A \"?\">\"/tmp/asd/arp.txt\"";
///调用命令
char ado[P+50];
///目录状态
int open;
///目录标记
int d;
///链接标记
int l;
///文件存在标记
int f;
///“剪贴板”
char Tick[10][P];
///“剪贴板”文件个数
int m;
///“剪贴板”写入标记
int n;
///临时变量
char c1,c2,c3,c4,c5;
char tmp1[P],tmp2[P];
int i1,i2,i3,i4,i5;
///文字
char ac1[9]="|#控制台 ";char ae1[9]="|CONSOLE ";
char ac2[15]="ASD-SIMPLE-DESK";char ae2[15]="ASD-SIMPLE-DESK";
char ac3[48]=" 按“H”键,再按“回车”键,以获取帮助。 ";
char ae3[48]="Press key<H>, then press key<Enter> to get help.";
char ac4[13]="当前路径: ";char ae4[13]="Present Path:";
char ac5[9]="|文件管理";char ae5[9]="| A F M |";
char ac6[9]="|命 令 行";char ae6[9]="|COMMAND|";
char ac7[9]="| 菜 单 |";char ae7[9]="| MANUE |";
char ac8[9]="| 设 置 |";char ae8[9]="| SETUP |";
char ac9[9]="| 离 开 |";char ae9[9]="| EXIT. |";
char ac10[4]="序号";char ae10[4]="Num ";
char ac11[8]="文件类别";char ae11[8]="Filetype";
char ac12[12]="待选文件列表";char ae12[12]="Selections ";
char ac13[12]="已选中的文件";char ae13[12]="Selected ";
char ac14[16]="显示详细资料 ";char ae14[16]="More Information";
char ac15[9]="简洁显示 ";char ae15[9]="Show Less";
char ac16[6]="页码:";char ae16[6]="Page: ";
char ac17[8]="上级目录";char ae17[8]="\"CD ..\" ";
char ac18[8]="向上翻页";char ae18[8]="PageUp ";
char ac19[8]="向下翻页";char ae19[8]="PageDown";
char ac20[8]="打开目录";char ae20[8]="OpenDir ";
char ac21[4]="撤销";char ae21[4]="Undo";
char ac22[4]="文件";char ae22[4]="file";char ac23[4]="目录";char ae23[4]="dir ";
char ac24[4]="链接";char ae24[4]="link";char ac25[4]="特殊";char ae25[4]="spec";
char ac26[4]="复制";char ae26[4]="Copy";
char ac27[4]="移动";char ae27[4]="Move";
char ac28[8]="新建目录";char ae28[8]="MakeDir ";
char ac29[6]="删除 ";char ae29[6]="Remove";
char ac30[6]="属性 ";char ae30[6]="Nature";
char mkdir[10]="mkdir -p ";
///文件操作命令
char copy[10]="cp -R ";
char move[10]="mv ";
char link[10]="ln -s ";
char remove[10]="rm -rf ";
///执行命令
char udo[P+50];
///FormA专用
char fac1[50]="ASD组件1:本机文件浏览器。 ";
char fae1[50]="ASD-PART1:Local-File-Viewer. ";
char fac2[50]="版本:0.9.6 ";
char fae2[50]="VERSION:0.9.6 ";
char fac3[50]="使用者:root专用。 ";
char fae3[50]="User: \"root\" only. ";
char fac4[50]="源代码:自由狼-台风 ";
char fae4[50]="SourceCode:Typhoon.Free.Wolf ";
char fac5[50]="测试:自由狼-台风 ";
char fae5[50]="CHECK:Typhoon.Free.Wolf ";
char fac6[50]="声明:本部分会在“/tmp”下生成临时文件,故要求 ";
char fae6[50]="ANOUNCE:This part will create a temproary file ";
char fac7[50]=" “/tmp”允许写入; ";
char fae7[50]=" in \"/tmp\",so \"/tmp\" must be writeable; ";
char fac8[50]=" 本部分调用的系统命令仅为“ls”和“mkdir”, ";
char fae8[50]=" This part calls system-command \"ls\" and ";
char fac9[50]=" 所以不会损坏你的文件。 ";
char fae9[50]=" \"mkdir\",so it won't broke your files.except ";
char fac10[50]=" 如果你的系统有问题则另当别论。 ";
char fae10[50]=" something wrong with your system. ";
char fac11[50]="版权:[Z] ";
char fae11[50]="CopyRight:[Z] ";
//\定义部分
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//初始化段
///窗口
Form='A';
///Form1 简洁显示
M='L';
///刷新asd[]
fre=1;
///目录状态
open=0;
///目录标记置0
d=0;
///链接判断置零
l=0;
///文件存在标记置零
f=0;
///“剪贴板”清空
for(i1=0;i1<10;i1++)
for(i2=0;i2<P;i2++)
Tick[i1][i2]=0;
m=0;
//\初始化段
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//语言选择
system("clear");
printf("\n\n\n\n\nDirectly press key<Enter> on your keyboard to run this programe in English.\n");
printf("\n\n\n\n\n直接在键盘上按“回车”键,本程序将以英文方式运行。\n");
printf("如果你能看懂这几行中文,并希望以中文方式运行本程序,\n");
printf("请先按键盘上的“C”键,再按“回车”键。\n");
L=getchar();
system("clear");
if(L=='c')
L='C';
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//ls特性确定
for(i1=0;i1<P;i1++)
tmp1[i1]=0;
system("mkdir -p /tmp/asd/");
system("ls -Al /bin/ls > /tmp/asd/als.txt");
als=fopen("/tmp/asd/als.txt","r");
i1=0;
while((c2=fgetc(als))!=EOF)
{
tmp1[i1]=c2;i1++;
}
for(i1=i1;i1>0;i1--)
if(tmp1[i1]==' ')
break;
N=i1;
//printf("\nChecking...\n");
//printf("i1=%d\n",i1);
//\ls特性确定
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS//
//主体循环
do
{
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///准备界面
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////清屏
for(i1=0;i1<Y;i1++)
for(i2=0;i2<X;i2++)
a[i1][i2]=' ';
///\清屏
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////公用标准边框
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////第一行、第末行
for(i1=2;i1<X-2;i1++)
a[0][i1]=a[21][i1]='=';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////第一列、地末列
for(i1=1;i1<21;i1++)
a[i1][0]=a[i1][1]=a[i1][X-2]=a[i1][X-1]='|';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////关节
a[0][0]=a[0][X-2]=a[21][0]=a[21][X-2]=a[6][9]=a[6][X-2]=a[21][9]='<';
a[0][1]=a[0][X-1]=a[21][1]=a[21][X-1]=a[6][10]=a[6][X-1]=a[21][10]='>';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////其他主线
for(i1=11;i1<X-2;i1++)
a[6][i1]='=';
for(i1=7;i1<21;i1++)
a[i1][9]=a[i1][10]='|';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////支线
for(i1=1;i1<6;i1++)
a[i1][10]='|';
a[3][10]='>';
for(i1=11;i1<X-3;i1++)
a[3][i1]='-';
for(i1=3;i1<8;i1++)
a[6][i1]=a[9][i1]=a[12][i1]=a[15][i1]=a[18][i1]='-';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////控制台
//////“图标”
a[1][4]=a[1][5]=a[1][6]='_';a[2][3]=a[2][7]='|';a[2][4]='#';
if(L=='C')
for(i1=0;i1<9;i1++)
a[3][i1+1]=ac1[i1];
else
for(i1=0;i1<9;i1++)
a[3][i1+1]=ae1[i1];
a[4][2]='/';a[4][3]=a[4][7]='_';a[4][4]='[';a[4][5]='A';a[4][6]=']';a[4][8]='\\';
//////标题栏
///////第一行
if(L=='C')
for(i1=0;i1<15;i1++)
a[1][i1+37]=ac2[i1];
else
for(i1=0;i1<15;i1++)
a[1][i1+37]=ae2[i1];
///////第二行
if(L=='C')
for(i1=0;i1<48;i1++)
a[2][i1+21]=ac3[i1];
else
for(i1=0;i1<48;i1++)
a[2][i1+21]=ae3[i1];
///////第三行
if(L=='C')
for(i1=0;i1<13;i1++)
a[4][i1+11]=ac4[i1];
else
for(i1=0;i1<13;i1++)
a[4][i1+11]=ae4[i1];
//////\标题栏
//////显示路径
i1=0;
for(i2=0;i2<X-13;i2++)
if(path1[i2]==0)
i1=1;
if(i1==1)
for(i1=11;i1<X-2;i1++)
{
if(path1[i1-11]==0)
break;
a[5][i1]=path1[i1-11];
}
else
{
for(i1=P-1;i1>0;i1--)
if(path1[i1]!=0)
break;
i2=X-3;
for(i1=i1;i1>0;i1--)
{
a[5][i2]=path1[i1];
if(i2==11)
break;
i2--;
}
}
//////\显示路径
//////控制板
///////文件管理
if(L=='C')
for(i1=0;i1<9;i1++)
a[7][i1+1]=ac5[i1];
else
for(i1=0;i1<9;i1++)
a[7][i1+1]=ae5[i1];
///////命令行
if(L=='C')
for(i1=0;i1<9;i1++)
a[10][i1+1]=ac6[i1];
else
for(i1=0;i1<9;i1++)
a[10][i1+1]=ae6[i1];
///////定制选单
if(L=='C')
for(i1=0;i1<9;i1++)
a[13][i1+1]=ac7[i1];
else
for(i1=0;i1<9;i1++)
a[13][i1+1]=ae7[i1];
///////设置项目
if(L=='C')
for(i1=0;i1<9;i1++)
a[16][i1+1]=ac8[i1];
else
for(i1=0;i1<9;i1++)
a[16][i1+1]=ae8[i1];
///////离开
if(L=='C')
for(i1=0;i1<9;i1++)
a[19][i1+1]=ac9[i1];
else
for(i1=0;i1<9;i1++)
a[19][i1+1]=ae9[i1];
///////控制键
a[8][4]=a[11][4]=a[14][4]=a[17][4]=a[20][4]='[';
a[8][6]=a[11][6]=a[14][6]=a[17][6]=a[20][6]=']';
if(Form!='A')
a[8][5]=a[11][5]=a[14][5]=a[17][5]=a[20][5]='_';
//////\控制板
/////\控制台
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
////\标准边框
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////FormA
if(Form=='A')
{
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////操作键
a[4][5]='_';
a[8][5]='1';
a[11][5]='2';
a[14][5]='3';
a[17][5]='4';
a[20][5]='0';
/////\操作键
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////内容
if(L=='C')
{
for(i1=0;i1<50;i1++)
a[7][11+i1]=fac1[i1];
for(i1=0;i1<50;i1++)
a[8][11+i1]=fac2[i1];
for(i1=0;i1<50;i1++)
a[9][11+i1]=fac3[i1];
for(i1=0;i1<50;i1++)
a[10][11+i1]=fac4[i1];
for(i1=0;i1<50;i1++)
a[11][11+i1]=fac5[i1];
for(i1=0;i1<50;i1++)
a[12][11+i1]=fac6[i1];
for(i1=0;i1<50;i1++)
a[13][11+i1]=fac7[i1];
for(i1=0;i1<50;i1++)
a[14][11+i1]=fac8[i1];
for(i1=0;i1<50;i1++)
a[15][11+i1]=fac9[i1];
for(i1=0;i1<50;i1++)
a[16][11+i1]=fac10[i1];
for(i1=0;i1<50;i1++)
a[17][11+i1]=fac11[i1];
}
else
{
for(i1=0;i1<50;i1++)
a[7][11+i1]=fae1[i1];
for(i1=0;i1<50;i1++)
a[8][11+i1]=fae2[i1];
for(i1=0;i1<50;i1++)
a[9][11+i1]=fae3[i1];
for(i1=0;i1<50;i1++)
a[10][11+i1]=fae4[i1];
for(i1=0;i1<50;i1++)
a[11][11+i1]=fae5[i1];
for(i1=0;i1<50;i1++)
a[12][11+i1]=fae6[i1];
for(i1=0;i1<50;i1++)
a[13][11+i1]=fae7[i1];
for(i1=0;i1<50;i1++)
a[14][11+i1]=fae8[i1];
for(i1=0;i1<50;i1++)
a[15][11+i1]=fae9[i1];
for(i1=0;i1<50;i1++)
a[16][11+i1]=fae10[i1];
for(i1=0;i1<50;i1++)
a[17][11+i1]=fae11[i1];
}
/////\内容
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
}
////\FormA
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////Form1
if(Form=='1')
{
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////刷新ash[]
if(fre==1)
{
fre=0;
num=0;pgmx=1;page=1;
//////归零
for(i1=0;i1<Z;i1++)
ash[i1]=0;
//////赋值1
for(i1=0;i1<P;i1++)
{
if(path1[i1]==0)
{
ash[i1]='\n';
break;
}
ash[i1]=path1[i1];
}
ash[i1+1]='*';ash[i1+2]='\n';
i3=i1+3;
//////\赋值1
//////交换
for(i1=0;i1<P;i1++)
path2[i1]=0;
for(i1=0;i1<P;i1++)
path2[i1]=path1[i1];
//printf("Checking...\n");
//printf("#%s#\nl=%d\n",path2,l);
//getchar();getchar();
//////\交换
//////列表
do
{
system("mkdir -p \"/tmp/asd/\"");
for(i1=0;i1<P+50;i1++)
ado[i1]=0;
for(i1=0;ls1[i1]!='?';i1++)
ado[i1]=ls1[i1];
i4=i1;i5=i1;
for(i1=0;path2[i1]!=0;i1++)
ado[i1+i4]=path2[i1];
i4=i1+i4;
for(i1=i5+1;ls1[i1]!=0;i1++,i4++)
ado[i4]=ls1[i1];
system(ado);
d=0;
als=fopen("/tmp/asd/als.txt","r");
c2=fgetc(als);
l=0;
if(c2=='l')
{
l=1;
for(i1=0;i1<P;i1++)//复位
path2[i1]=0; //path2[]
while((c2=fgetc(als))!=EOF)
if(c2=='>')
break;
fgetc(als);
i1=0;
while((c2=fgetc(als))!=EOF)
{
if(c2=='\n')
break;
path2[i1]=c2;i1++;
//printf("%c",path2[i1]);
}
fclose(als);
//printf("\nChecking2...\n");
//printf("#%s#\nl=%d\n",path2,l);
//getchar();getchar();
}
else
{
while((c2=fgetc(als))!='\n')
;
i1=i3;
}
//printf("Checing3...\n");
//printf("#%s#\nl=%d\n",path2,l);
//getchar();getchar();
}
while(l==1);
//////\列表
//////继续创建数组
while((c2=fgetc(als))!=EOF)
{
///////序号和页码
if(num==10)
{
num=0;pgmx++;
ash[i1]='*';i1++;
ash[i1]='\n';i1++;
}
///////\序号和页码
if(c2=='\n')
{
///////添加“?”
ash[i1]='?';//末尾“?”
i2=i1; //退回
do //本行
i2--; //的开
while(ash[i2]!='\n');//头
while(ash[i2+N]!=' ')//文件头//历经
i2++; //部定位//考验
ash[i2+N]='?';//开头“?”
i2=i1; //退回
do //本行
i2--; //的开
while(ash[i2]!='\n');//头
do //寻找链接
i2++; //的真实位
while(ash[i2]!='>');//置
ash[i2+1]=ash[i2-2]='?';//中间“?”
i1++;
///////\添加“?”
num++;//序号
}
ash[i1]=c2;
i1++;
}
fclose(als);
//////\继续创建数组
/*////ash[]监视记录
dbg=fopen("/root/123/log.txt","w");
printf("Logging...\n");
getchar();getchar();
for(i1=0;i1<Z;i1++)
fputc(ash[i1],dbg);
fclose(dbg);
/*////\ash[]监视记录
}
////\刷新ash[]
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////简洁模式
if(M=='L')
{
//////边框
for(i1=0;i1<5;i1++)
a[6][i1+6]=a[9][i1+6]='=';
a[7][10]=a[8][9]=a[8][10]=' ';
a[9][9]='<';a[9][10]='>';
for(i1=0;i1<10;i1++)
a[i1+9][(X-1)/2+12]='|';
//////\边框
//////基本控制键
a[19][23]=a[19][35]=a[20][11]=a[20][23]=a[20][35]='[';
a[19][24]='E';a[19][36]='_';a[20][12]='S';a[20][24]='D';
a[20][36]='_';
a[19][25]=a[19][37]=a[20][13]=a[20][25]=a[20][37]=']';
a[8][(X-1)/2-7]='[';a[8][(X-1)/2-7+1]='M';a[8][(X-1)/2-7+2]=']';
if(page==1)
a[19][24]='_';
if(page==pgmx)
a[20][24]='_';
if(open==0)
a[19][36]='F';
if(open==1||Tick[0][0]!=0)//要扩展
a[20][36]='G';
//////\基本控制键
//////序号键
for(i1=9;i1<19;i1++)
{
a[i1][11]='[';a[i1][12]='_';a[i1][13]=']';
}
//////\序号键
//////显示页码
if(page<9999)
{
a[19][17]=page/1000+'0';
a[19][18]=page/100+'0';
a[19][19]=page/10+'0';
a[19][20]=page%10+'0';
}
else
a[19][17]=a[19][18]=a[19][19]=a[19][20]='-';
//////\显示页码
//////提示文字
if(L=='C')
{
for(i1=0;i1<4;i1++)
a[7][11+i1]=ac10[i1];//序号
for(i1=0;i1<8;i1++)
a[7][16+i1]=ac11[i1];//文件类别
for(i1=0;i1<12;i1++)
a[7][25+i1]=ac12[i1];//待选文件列表
for(i1=0;i1<12;i1++)
a[7][(X-1)/2+13+i1]=ac13[i1];//已选中的文件
for(i1=0;i1<6;i1++)
a[19][11+i1]=ac16[i1];//页码:
for(i1=0;i1<8;i1++)
a[20][14+i1]=ac17[i1];//上级目录
for(i1=0;i1<8;i1++)
a[19][26+i1]=ac18[i1];//向上翻页
for(i1=0;i1<8;i1++)
a[20][26+i1]=ac19[i1];//向下翻页
for(i1=0;i1<8;i1++)
a[19][38+i1]=ac20[i1];//打开目录
for(i1=0;i1<4;i1++)
a[20][38+i1]=ac21[i1];//撤销
for(i1=0;i1<16;i1++)
a[8][(X-1)/2-7+3+i1]=ac14[i1];//显示详细资料
}
else
{
a[7][9]=' ';//计划外的小修补
for(i1=0;i1<4;i1++)
a[7][11+i1]=ae10[i1];//Num
for(i1=0;i1<8;i1++)
a[7][16+i1]=ae11[i1];//Filetype
for(i1=0;i1<12;i1++)
a[7][25+i1]=ae12[i1];//SELECTIONS
for(i1=0;i1<12;i1++)
a[7][(X-1)/2+13+i1]=ae13[i1];//SELECTED
for(i1=0;i1<6;i1++)
a[19][11+i1]=ae16[i1];//Page:
for(i1=0;i1<8;i1++)
a[20][14+i1]=ae17[i1];//CD..
for(i1=0;i1<8;i1++)
a[19][26+i1]=ae18[i1];//PageUp
for(i1=0;i1<8;i1++)
a[20][26+i1]=ae19[i1];//PageDown
for(i1=0;i1<8;i1++)
a[19][38+i1]=ae20[i1];//OpenDir
for(i1=0;i1<4;i1++)
a[20][38+i1]=ae21[i1];//Undo
for(i1=0;i1<16;i1++)
a[8][(X-1)/2-7+3+i1]=ae14[i1];//More information
}
//////\提示文字
//////基本内容
///////填写序号
if(page==pgmx)
for(i1=1;i1<num+1;i1++)
{
a[8+i1][12]=i1+'0';
if(i1==10)
a[8+i1][12]='0';
}
else
{
for(i1=0;i1<9;i1++)
a[9+i1][12]=i1+'1';
a[9+i1][12]='0';
}
///////\填写序号
///////页码定位
i3=i4=0;
do
{
if(ash[i3]=='*')
i4++;
i3++;
}
while(i4<page);
i3++;//必须有,影响“文件类别”判断
///////\页码定位
///////填写主要部分
for(i1=9;i1<19;i1++)
{
////////文件类别
if(ash[i3]=='-')
{
if(L=='C')
for(i4=0;i4<4;i4++)
a[i1][16+i4]=ac22[i4];
else
for(i4=0;i4<4;i4++)
a[i1][16+i4]=ae22[i4];
if(open==1)
a[i1][12]='_';
}
else if(ash[i3]=='d')
if(L=='C')
for(i4=0;i4<4;i4++)
a[i1][16+i4]=ac23[i4];
else
for(i4=0;i4<4;i4++)
a[i1][16+i4]=ae23[i4];
else if(ash[i3]=='l')
if(L=='C')
for(i4=0;i4<4;i4++)
a[i1][16+i4]=ac24[i4];
else
for(i4=0;i4<4;i4++)
a[i1][16+i4]=ae24[i4];
else if(ash[i3]==0)
break;
else
{
if(L=='C')
for(i4=0;i4<4;i4++)
a[i1][16+i4]=ac24[i4];
else
for(i4=0;i4<4;i4++)
a[i1][16+i4]=ae24[i4];
if(open==1)
a[i1][12]='_';
}
////////\文件类别
////////到达文件名
do
i3++;
while(ash[i3]!='?');
i3++;
////////\到达文件名
////////待选文件列表
for(i2=25;i2<(X-1)/2+11;i2++)
{
if(ash[i3]=='?')
break;
a[i1][i2]=ash[i3];
i3++;
}
////////\待选文件列表
////////善后
do
i3++;
while(ash[i3]!='\n'&&ash[i3]!=0);
i3++;
if(ash[i3]==0)
break;
////////\善后
}
///////\填写主要部分
///////填写选中部分
for(i1=9;i1<19;i1++)
{
////////初始化tmp1[]
for(i3=0;i3<P;i3++)
tmp1[i3]=0;
////////填写tmp1[]
for(i2=0;i2<P;i2++)
if(Tick[i1-9][i2]=='?')
break;
i2++;
for(i2=i2;i2<P;i2++)
if(Tick[i1-9][i2]=='?')
break;
for(i2=i2;i2>0;i2--)
if(Tick[i1-9][i2]=='/')
break;
i2++;
i3=i2;
//system("clear");
//printf("\nChecking...\n");
//printf("i3=%d",i3);
//getchar();getchar();
//system("clear");
for(i2=0;i3<P;i2++,i3++)
{
if(Tick[i1-9][i3]=='?')
break;
tmp1[i2]=Tick[i1-9][i3];
}
////////填写显示区域
for(i2=(X-1)/2+14;i2<X-2;i2++)
{
if(tmp1[i2-((X-1)/2+14)]==0)
break;
a[i1][i2]=tmp1[i2-((X-1)/2+14)];
}
////////\填写显示区域
}
///////\填写选中部分
//////\基本内容
//////文件操作控制键
a[19][47]=a[19][55]=a[19][63]=a[20][43]=a[20][55]=a[20][65]='[';
a[19][48]=a[19][56]=a[19][64]=a[20][44]=a[20][56]=a[20][66]='_';
a[19][49]=a[19][57]=a[19][65]=a[20][45]=a[20][57]=a[20][67]=']';
///////新建目录提示
a[20][44]='N';
if(L=='C')
for(i1=0;i1<8;i1++)
a[20][46+i1]=ac28[i1];
else
for(i1=0;i1<8;i1++)
a[20][46+i1]=ae28[i1];
///////复制提示
if(open==0&&Tick[0][0]!=0)
a[19][48]='J';
if(L=='C')
for(i1=0;i1<4;i1++)
a[19][50+i1]=ac26[i1];
else
for(i1=0;i1<4;i1++)
a[19][50+i1]=ae26[i1];
///////移动提示
if(open==0&&Tick[0][0]!=0)
a[19][56]='K';
if(L=='C')
for(i1=0;i1<4;i1++)
a[19][58+i1]=ac27[i1];
else
for(i1=0;i1<4;i1++)
a[19][58+i1]=ae27[i1];
///////链接提示
if(open==0&&Tick[0][0]!=0)
a[19][64]='L';
if(L=='C')
for(i1=0;i1<4;i1++)
a[19][66+i1]=ac24[i1];
else
for(i1=0;i1<4;i1++)
a[19][66+i1]=ae24[i1];
///////删除提示
if(open==0&&Tick[0][0]!=0)
a[20][56]='X';
if(L=='C')
for(i1=0;i1<6;i1++)
a[20][58+i1]=ac29[i1];
else
for(i1=0;i1<6;i1++)
a[20][58+i1]=ae29[i1];
///////属性提示
if(open==0&&Tick[0][0]!=0)
a[20][66]='P';
if(L=='C')
for(i1=0;i1<6;i1++)
a[20][68+i1]=ac30[i1];
else
for(i1=0;i1<6;i1++)
a[20][68+i1]=ae30[i1];
//////文件操作控制键
}
/////\简洁模式
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////详细模式
else
{
//////边框
for(i1=11;i1<X-2;i1++)
a[1][i1]=a[2][i1]=a[3][i1]=' ';
a[3][0]=a[3][1]=a[3][10]=a[3][X-2]=a[3][X-1]='=';
for(i1=4;i1<Y;i1++)
for(i2=0;i2<X;i2++)
a[i1][i2]=' ';
//////\边框
//////控制键
a[1][23]=a[1][35]=a[2][11]=a[2][23]=a[2][35]='[';
a[1][24]='E';a[1][36]='_';a[2][12]='S';a[2][24]='D';
a[2][36]='_';
a[1][25]=a[1][37]=a[2][13]=a[2][25]=a[2][37]=']';
a[1][47]='[';a[1][48]='M';a[1][49]=']';
if(page==1)
a[1][24]='_';
if(page==pgmx)
a[2][24]='_';
if(open==0)
a[1][36]='F';
if(open==1||Tick[0][0]!=0)//要扩展
a[2][36]='G';
//////\控制键
//////显示路径
for(i1=11;i1<X-2;i1++)
if(path1[i1-11]!=0)
a[3][i1]=path1[i1-11];
//////显示页码
if(page<9999)
{
a[1][17]=page/1000+'0';
a[1][18]=page/100+'0';
a[1][19]=page/10+'0';
a[1][20]=page%10+'0';
}
else
a[1][17]=a[1][18]=a[1][19]=a[1][20]='-';
//////\显示页码
//////提示文字
if(L=='C')
{
for(i1=0;i1<6;i1++)
a[1][11+i1]=ac16[i1];//页码:
for(i1=0;i1<8;i1++)
a[2][14+i1]=ac17[i1];//上级目录
for(i1=0;i1<8;i1++)
a[1][26+i1]=ac18[i1];//向上翻页
for(i1=0;i1<8;i1++)
a[2][26+i1]=ac19[i1];//向下翻页
for(i1=0;i1<8;i1++)
a[1][38+i1]=ac20[i1];//打开目录
for(i1=0;i1<8;i1++)
a[2][38+i1]=ac21[i1];//取消操作
for(i1=0;i1<9;i1++)
a[1][50+i1]=ac15[i1];//简洁显示
}
else
{
for(i1=0;i1<6;i1++)
a[1][11+i1]=ae16[i1];//Page:
for(i1=0;i1<8;i1++)
a[2][14+i1]=ae17[i1];//CD..
for(i1=0;i1<8;i1++)
a[1][26+i1]=ae18[i1];//PageUp
for(i1=0;i1<8;i1++)
a[2][26+i1]=ae19[i1];//PageDown
for(i1=0;i1<8;i1++)
a[1][38+i1]=ae20[i1];//OpenDir
for(i1=0;i1<8;i1++)
a[2][38+i1]=ae21[i1];//Don't-Do
for(i1=0;i1<9;i1++)
a[1][50+i1]=ae15[i1];//Show Less
}
//////\提示文字
//////显示内容
///////页码定位
i3=i4=0;
do
{
if(ash[i3]=='*')
i4++;
i3++;
}
while(i4<page);
i3++;//必须有,影响“文件类别”判断
///////\页码定位
///////填写显示区域
for(i1=4,i2=0;i2<X;i2++)
{
if(ash[i3]=='*'||ash[i3]==0)
break;
if(ash[i3]=='\n'||i2==X-1)
{
i1++;i2=0-1;
}
else if(ash[i3]=='?')
a[i1][i2]='\"';
else
a[i1][i2]=ash[i3];
i3++;
}
///////\填写显示区域
//////\显示内容
}
/////\详细模式
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
}
////\Form1
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////-->Form2
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////-->Form3
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
///\准备界面
///EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE///
///EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE///
///EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///显示界面
a[0][2]='=';//强化
system("clear");
for(i1=0;i1<Y;i1++)
{
for(i2=0;i2<X;i2++)
{
printf("%c",a[i1][i2]);
}
printf("\n");
}
///EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE///
///EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE///
///EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///取得字符
c1=getchar();
///EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE///
///EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE///
///EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS///
///输入解释
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////For FormA
if(Form=='A')
{
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
n=0;
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////“文件浏览器”版权
if((c1=='Z'||c1=='z')&&n==1)
if(L=='C')
{
system("clear");
printf("版权:\n");
printf("________________________________________\n");
printf("\n");
printf("任何人或单位,只要认为值得,均可复制、分发程序的这个部分,但\n");
printf("是必须满足以下条件:\n\n");
printf(" 01 分发物必须包括程序“这个部分”(即“本机文件浏览器”)\n");
printf(" 的代码;\n\n");
printf(" 02 允许修改“这个部分”,并再次发行,但是必须在屏幕上明\n");
printf(" 显的位置显示“修改:某人”字样;\n\n");
printf(" 03 “这个部分”未经过实质修改的部分不得在分发时收取任何\n");
printf(" 费用,未经修改的部分的代码也必须一起分发。\n\n");
printf("________________________________________\n");
printf("\n");
printf("按回车键回主界面。\n");
getchar();getchar();
system("clear");
}
else
{
system("clear");
printf("CopyRight:\n");
printf("________________________________________\n");
printf("\n");
printf(" Any person or company can copy and send out THIS PART of this\n");
printf("programe,if you accept the things below:\n\n");
printf(" 01 The things sent out must include the SourceCode of \"THIS\n");
printf(" PART\"(the \"Local-File-Exploer\");\n\n");
printf(" 02 You can modify \"THIS PART\" befor send out,but you must\n");
printf(" print the name who modified it on main user-interface.\n\n");
printf(" 03 You musn't collect money by sending it out if you haven't\n");
printf(" make natural modify,and the un-modified part of \"THIS PART\"\n");
printf(" must be included in the things sent out.\n");
printf("________________________________________\n");
printf("\n");
printf("Press key<Enter> to go back to the main user-interface.\n");
getchar();getchar();
system("clear");
}
/////\“文件浏览器”版权
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////文件管理
if(c1=='1')
Form='1';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////命令
if(c1=='2')
Form='2';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
///菜单
if(c1=='3')
Form='3';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
///设置
if(c1=='4')
Form='4';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
}
////\For FormA
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS////
////For Form1
if(Form=='1')
{
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////控制台
if(c1=='A'||c1=='a')
Form='A';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
////显示模式
if((c1=='M'||c1=='m')&&M=='L')
M='M';
else if((c1=='M'||c1=='m')&&M=='M')
M='L';
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
////上级目录
if(c1=='S'||c1=='s')
if(path1[1]!=0)
{
for(i1=P-1;i1>0;i1--)
if(path1[i1]!=0)
break;
do //末尾
{ //是否
path1[i1]=0; //有
i1--; //“/”
} // 均可
while(path1[i1]!='/');//适应
fre=1;
}
////\上级目录
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
////翻页
if(c1=='E'||c1=='e')
if(page>1)
page--;
if(c1=='D'||c1=='d')
if(page<pgmx)
page++;
////\翻页
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
////打开目录
if(c1=='F'||c1=='f')
open=1;
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
////取消操作
if(c1=='G'||c1=='g')
if(open==1)//要扩展
open=0;
else if(m>0)
{
m--;
for(i1=0;i1<P;i1++)
Tick[m][i1]=0;
}
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
////如果是数字键
if(c1<='9'&&c1>='0'&&n==1)
{
/////页码定位
i3=i4=0;
do
{
if(ash[i3]=='*')
i4++;
i3++;
}
while(i4<page);
i3++;
/////\页码定位
/////序号定位
i5=0;
if(c1=='0')
i4=10;
else
i4=c1-'0';
i5=i4;
/*system("clear");
printf("Checking...\n");
printf("num=%d,i5=%d\n",num,i5);
getchar();getchar();
system("clear");*/
i4--;
while(i4!=0)
{
if(ash[i3]==0)
break;
if(ash[i3]=='\n')
i4--;
i3++;
}
/////\序号定位
/////性质标记
if(ash[i3]=='d')
d=1;
if(ash[i3]=='l')
l=1;
if(page<pgmx||(page==pgmx&&i5<=num))
f=1;
else
f=0;
//system("clear");
//printf("Checking...\n");
//printf("open=%d d=%d l=%d f=%d\n",open,d,l,f);
//getchar();getchar();
/////\性质标记
/////如果打开目录
if(open==1&&f==1)
{
if(d==1||l==1)
{
//////原路径末尾处理
i1=0;
do
i1++;
while(path1[i1]!=0);
if(path1[i1-1]!='/')
{
path1[i1]='/';
i1++;
}
//printf("\nChecking...\n");//性
//printf("%s\n",path1); //能
//printf("\nEnded.\n"); //可
//getchar(); //靠
//getchar(); //。
///////\原有路径尾部调整
///////添加新的部分
i3=i3;
do
i3++;
while(ash[i3]!='?');
i3++;
for(i1=i1,i3=i3;ash[i3]!='?';i1++,i3++)
path1[i1]=ash[i3];
///////\添加新的部分
//////新路径末尾处理
if(d==1)
{
i1=0;
do
i1++;
while(path1[i1]!=0);
if(path1[i1-1]!='/')
{
path1[i1]='/';
i1++;
}
}
//////\新路径末尾处理
//printf("\nChecking...\n");//性
//printf("%s\n",path1); //能
//printf("\nEnded.\n"); //可
//getchar(); //靠
//getchar(); //。
fre=1;open=0;
}
}
/////\如果打开目录
//printf("Checking...\n");
//printf("open=%d d=%d l=%d\n",open,d,l);
//getchar();getchar();
/////否则(即不是路径)
else if(f==1)
{
i2=m; //“剪贴
if(m<10)//板”标
m++; //记跳变
///////把文件属性装进“剪贴板”
i3=i3;i1=0;
do
{
Tick[i2][i1]=ash[i3];
i1++;i3++;
}
while(ash[i3]!='?');
Tick[i2][i1]='?';
i1++;i3++;
///////把文件属性路径装进“剪贴板”
//////原路径末尾处理
i4=0;
do
i4++;
while(path1[i4]!=0);
if(path1[i4-1]!='/')
{
path1[i4]='/';
i4++;
}
///////\原有路径尾部调整
///////把路径装进“剪贴板”
i1=i1;i4=0;
if(i2<10)
while(path1[i4]!=0)
{
Tick[i2][i1]=path1[i4];
i1++;i4++;
}
///////\把路径装进“剪贴板”
///////把文件名装入“剪贴板”
i3=i3;
for(i1=i1,i3=i3;ash[i3]!='\n';i1++,i3++)
Tick[i2][i1]=ash[i3];
///////\把文件名装入“剪贴板”
}
/////\否则(即不是路径)
//printf("Checking...\n");
//printf("open=%d d=%d l=%d\n",open,d,l);
/*system("clear");
printf("Checking...\n");
for(i1=0;i1<10;i1++)
{
printf("\n");
for(i2=0;i2<P;i2++)
printf("%c",Tick[i1][i2]);
}
printf("\n");
getchar();getchar();
system("clear");*/
d=l=f=0;
}
/////\如果是数字键
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
/////新建目录
if((c1=='N'||c1=='n')&&n==1)
{
//////交互提示
system("clear");
if(L=='C')
{
printf("请输入新目录的名称,然后按回车键。\n");
printf("名称中不要包含这些字符:“>”、“\"”、“?”和“*”。\n");
printf("如果不想新建目录,请直接按回车键。\n\n");
}
else
{
printf("Please enter the name of new directory,then press key<Enter>.\n\n");
printf("DO NOT include such charaters:\'>\',\'\"\',\'?\'and\'*\'.\n");
printf("Directly press to go back without making new directory.\n\n");
}
getchar();
//////\交互提示
for(i1=0;i1<P;i1++)
tmp2[i1]=0;
for(i1=0;i1<P;i1++)
{
c3=getchar();
if(c3=='\n')
break;
tmp2[i1]=c3;
}
c3=0;
for(i1=0;i1<P+50;i1++)
ado[i1]=0;
for(i1=0;i1<10;i1++)
ado[i1]=mkdir[i1];
ado[10]='\"';
i1++;
if(tmp2[0]=='/')//绝对路径
for(i1=i1;tmp2[i1-11]!=0;i1++)
ado[i1]=tmp2[i1-11];
else//相对路径
{
for(i1=i1;i1-11<P;i1++)
{
ado[i1]=path1[i1-11];
if(ado[i1]==0)
{
if(ado[i1-1]!='/')
{
ado[i1]='/';
i1++;
}
break;
}
}
i2=i1;
if(tmp2[0]=='.'&&tmp2[1]=='/')
for(i1=i1;tmp2[i1-i2+2]!=0;i1++)
ado[i1]=tmp2[i1-i2+2];
else
for(i1=i1;tmp2[i1-i2]!=0;i1++)
ado[i1]=tmp2[i1-i2];
}
ado[i1]='\"';
//printf("Checking...\n%s\n",ado);
//getchar();
system(ado);
fre=1;
system("clear");
}
/////\新建目录
/////EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE/////
/////SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/////
if(n==1)
{
/////=======================================================
/////#######################################################
/////-以下为文件操作部分(在源代码家级不属于本“文件浏览器”)
/////=======================================================================================================================================================
/////此处由附带的文挡提供。编译时,请将“cp.txt”(复制)、“mv.txt”(移动)、“ln.txt”(链接)、“rm.txt”(删除)、“ch.txt”(属性)(如果有的话)完整地复制到此处。
/////此处的文件操作基本都是测试版,欢迎大家提供更好的方案。所有选中并等待操作的文件及其完全路径均在数组Tick[][]里,需要的话尽管用吧。
/////=======================================================================================================================================================
/////复制
if(M=='L'&&(c1=='J'||c1=='j')&&open==0&&Tick[0][0]!=0)
{
system("clear");
if(L=='C')
{
printf("ASD组件3:文件操作----复制\n版本:0.8.0\n\n");
printf("不支持强制覆盖\n\n不对可能造成的损害进行担保。\n");
printf("源代码:自由狼-台风\n");
printf("测试:自由狼-台风\n");
printf("________________________________________\n\n");
printf(" [1]复制到当前目录\n");
if(Tick[1][0]==0)
printf(" [2]复制到当前目录并改名\n");
printf(" [0]取消\n");
printf(" [Z]关于\n");
printf("________________________________________\n\n");
}
else
{
printf("ASD-PART3:Operate-Copy\nVersion:0.8.0\n\n");
printf("Replace by force is not supported\n\n");
printf("SourceCode:Typhoon.Free.Wolf\n");
printf("Check:Typhoon.Free.Wolf\n");
printf("________________________________________\n\n");
printf(" [1]Copy to current directory\n");
if(Tick[1][0]==0)
printf(" [2]Copy to current directory and rename\n");
printf(" [0]Cancle\n");
printf(" [Z]About\n");
printf("________________________________________\n\n");
}
getchar();
c3=getchar();
if(c3=='Z'||c3=='z')
if(L=='C')
{
system("clear");
printf("版权:\n");
printf("________________________________________\n");
printf("\n");
printf("任何人或单位,只要认为值得,均可复制、分发程序的这个部分,但\n");
printf("是必须满足以下条件:\n\n");
printf(" 01 分发物必须包括程序“这个部分”(即“文件操作----复制”)\n");
printf(" 的代码;\n\n");
printf(" 02 允许修改“这个部分”,并再次发行,但是必须在屏幕上明\n");
printf(" 显的位置显示“修改:某人”字样;\n\n");
printf(" 03 “这个部分”未经过实质修改的部分不得在分发时收取任何\n");
printf(" 费用,未经修改的部分的代码也必须一起分发。\n\n");
printf("________________________________________\n");
printf("\n");
printf("按回车键返回。\n");
getchar();getchar();
system("clear");
}
else
{
system("clear");
printf("CopyRight:\n");
printf("________________________________________\n");
printf("\n");
printf(" Any person or company can copy and send out THIS PART of this\n");
printf("programe,if you accept the things below:\n\n");
printf(" 01 The things sent out must include the SourceCode of \"THIS\n");
printf(" PART\"(the \"Operate-Copy\");\n\n");
printf(" 02 You can modify \"THIS PART\" befor send out,but you must\n");
printf(" print the name who modified it on main user-interface.\n\n");
printf(" 03 You musn't collect money by sending it out if you haven't\n");
printf(" make natural modify,and the un-modified part of \"THIS PART\"\n");
printf(" must be included in the things sent out.\n");
printf("________________________________________\n");
printf("\n");
printf("Press key<Enter> to go back.\n");
getchar();getchar();
system("clear");
}
else if(c3=='1')
{
for(i1=0;i1<m;i1++)
{
for(i2=0;i2<P+50;i2++)//调命令
udo[i2]=0;
for(i2=0;i2<10;i2++)
udo[i2]=copy[i2];
for(i3=0;Tick[i1][i3]!='?';i3++)//源文件
;
udo[i2]='\"';
i2++;i3++;
for(i2=i2,i3=i3;Tick[i1][i3]!='?';i2++,i3++)
udo[i2]=Tick[i1][i3];
udo[i2]='\"';
i2++;
udo[i2]=' ';
i2++;
udo[i2]='\"';//目的地
i2++;
i3=i2;
for(i2=i2;i2-i3<P-50;i2++)
{
udo[i2]=path1[i2-i3];//路径继承
if(udo[i2]==0)
{
if(udo[i2-1]!='/')
{
udo[i2]='/';
i2++;
}
break;
}
}
udo[i2]='\"';
printf("udo=%s\n",udo);
system(udo);
}
if(L=='C')
printf("\n 复制到当前目录完成\n");
else
printf("\n Copied to current dictory\n");
}
else if(c3=='2'&&Tick[1][0]==0)
{
if(L=='C')
printf("请输入新的名称,然后按“回车键”:\n");
else
printf("Please enter new name,then press key<Enter>:\n");
for(i2=0;i2<P+50;i2++)//调命令
udo[i2]=0;
for(i2=0;i2<10;i2++)
udo[i2]=copy[i2];
for(i3=0;Tick[0][i3]!='?';i3++)//源文件
;
udo[i2]='\"';
i2++;i3++;
for(i2=i2,i3=i3;Tick[0][i3]!='?';i2++,i3++)
udo[i2]=Tick[0][i3];
udo[i2]='\"';
i2++;
udo[i2]=' ';
i2++;
udo[i2]='\"';//目的地
i2++;
i3=i2;
for(i2=i2;i2-i3<P-50;i2++)
{
udo[i2]=path1[i2-i3];//路径继承
if(udo[i2]==0)
{
if(udo[i2-1]!='/')
{
udo[i2]='/';
i2++;
}
break;
}
}
i3=i2;
getchar();c1=getchar();
for(i1=0;i1<P;i1++)//新的名称
{
if(c1=='\n')
break;
udo[i2]=c1;
i2++;
c1=getchar();
}
udo[i2]='\"';
system(udo);
printf("udo=%s\n",udo);
if(L=='C')
printf("\n 复制到当前目录并且改名完成\n");
else
printf("\n Copied to this dictory and renamed\n");
}
fre=1;
system("clear");
}
/////\复制
/////移动
if(M=='L'&&(c1=='K'||c1=='k')&&open==0&&Tick[0][0]!=0)
{
system("clear");
if(L=='C')
{
printf("ASD组件4:文件操作----移动\n版本:0.8.0\n\n");
printf("不支持强制覆盖\n\n不对可能造成的损害进行担保。\n");
printf("源代码:自由狼-台风\n");
printf("测试:自由狼-台风\n");
printf("________________________________________\n\n");
printf(" [1]移动到当前目录\n");
if(Tick[1][0]==0)
printf(" [2]移动到当前目录并改名\n");
printf(" [0]取消\n");
printf(" [Z]关于\n");
printf("________________________________________\n\n");
}
else
{
printf("ASD-PART4:Operate-Move\nVersion:0.8.0\n\n");
printf("Replace by force is not supported\n\n");
printf("SourceCode:Typhoon.Free.Wolf\n");
printf("Check:Typhoon.Free.Wolf\n");
printf("________________________________________\n\n");
printf(" [1]Move to current directory\n");
if(Tick[1][0]==0)
printf(" [2]Move to current directory and rename\n");
printf(" [0]Cancle\n");
printf(" [Z]About\n");
printf("________________________________________\n\n");
}
getchar();
c3=getchar();
if(c3=='Z'||c3=='z')
if(L=='C')
{
system("clear");
printf("版权:\n");
printf("________________________________________\n");
printf("\n");
printf("任何人或单位,只要认为值得,均可复制、分发程序的这个部分,但\n");
printf("是必须满足以下条件:\n\n");
printf(" 01 分发物必须包括程序“这个部分”(即“文件操作----复制”)\n");
printf(" 的代码;\n\n");
printf(" 02 允许修改“这个部分”,并再次发行,但是必须在屏幕上明\n");
printf(" 显的位置显示“修改:某人”字样;\n\n");
printf(" 03 “这个部分”未经过实质修改的部分不得在分发时收取任何\n");
printf(" 费用,未经修改的部分的代码也必须一起分发。\n\n");
printf("________________________________________\n");
printf("\n");
printf("按回车键返回。\n");
getchar();getchar();
system("clear");
}
else
{
system("clear");
printf("CopyRight:\n");
printf("________________________________________\n");
printf("\n");
printf(" Any person or company can copy and send out THIS PART of this\n");
printf("programe,if you accept the things below:\n\n");
printf(" 01 The things sent out must include the SourceCode of \"THIS\n");
printf(" PART\"(the \"Operate-Copy\");\n\n");
printf(" 02 You can modify \"THIS PART\" befor send out,but you must\n");
printf(" print the name who modified it on main user-interface.\n\n");
printf(" 03 You musn't collect money by sending it out if you haven't\n");
printf(" make natural modify,and the un-modified part of \"THIS PART\"\n");
printf(" must be included in the things sent out.\n");
printf("________________________________________\n");
printf("\n");
printf("Press key<Enter> to go back.\n");
getchar();getchar();
system("clear");
}
else if(c3=='1')
{
for(i1=0;i1<m;i1++)
{
for(i2=0;i2<P+50;i2++)//调命令
udo[i2]=0;
for(i2=0;i2<10;i2++)
udo[i2]=move[i2];
for(i3=0;Tick[i1][i3]!='?';i3++)//源文件
;
udo[i2]='\"';
i2++;i3++;
for(i2=i2,i3=i3;Tick[i1][i3]!='?';i2++,i3++)
udo[i2]=Tick[i1][i3];
udo[i2]='\"';
i2++;
udo[i2]=' ';
i2++;
udo[i2]='\"';//目的地
i2++;
i3=i2;
for(i2=i2;i2-i3<P-50;i2++)
{
udo[i2]=path1[i2-i3];//路径继承
if(udo[i2]==0)
{
if(udo[i2-1]!='/')
{
udo[i2]='/';
i2++;
}
break;
}
}
udo[i2]='\"';
printf("udo=%s\n",udo);
} |
|