1, determine whether the file exists, does not exist to create a file[Java]View Plaincopyprint?
File file=new file ("c:\\users\\qping\\desktop\\javascript\\2.htm");
if (!file.exists ())
{
try {
File.createnewfile ();
} catch
Shell determines if file/directory is emptyCategory: Linux 2010-05-29 17:06 3512 People read review (0) Favorite report Shell file
At the beginning of the shell, a lot of the internet is not looking for the West looking for.
#判断文件目录是否为空
The first
Upload file to determine if file name is repeated please advise
How do I tell the file name to repeat when uploading files?
Uploading Files I know
$_files["Form name"]
$_files["Form name" ["Name"] Name
How do I get the image name in the upload path
Edison Chen's Sex photo scandal may be avoided if File Delete Absolutely was used.
Nowadays, people are afraid of the leaking of their secrets result from deleted file recovery more and more because they depend on computers more and more.
There is such a code in the init.php file in Ecshop
if (__file__ = = ")//This line does not want to understand, is it necessary to write, the absolute path of the current file under what circumstances will be empty??
{
Die (' Fatal error code:0 ');
The following HTML code like
The code is as follows
Copy Code
File Upload:
Our most commonly used in the front of the simple to judge
The code is as follows
Copy Code
If
Test Condition Expression Description
File symbols:
[Root@lamp test]# Help testtest:test [expr]Evaluate conditional expression.Exits with a status of 0 (True) or 1 (false) depending onThe evaluation of EXPR. Expressions May is unary or binary.
Conditional expression ("CONDITIONAL EXPRESSIONS")
Conditional expressions are used in [composite commands and built-in command test and [to test file properties for string and arithmetic comparisons.] An expression is constructed using the
$ () and "(anti-quote ) are used to do command substitution. Next, let's see ${} ... It's actually used for variable substitution. Shell if interpretation statements are common:[Front and rear spaces] Front Space[-D file] True if file exists and
Recently scripting, I often see conditional statements with the IF [-X $variable] class, not knowing what the meaning of the corresponding parameter is,The excerpt is as follows: from http://blog.csdn.net/aaaaatiger/article/details/1713611thanks!1[ -
The meaning of the-Z to-D in the conditional judgment in the shell
[-A file] if FILE existence is true.
[-B-file] True if file exists and is a block-specific file.
[-C file] is true if file exists and is a word special file.
[-D file] is true if
The meaning of the-Z to-D in the conditional judgment in the shell
Copyright Notice: This article original articles for bloggers, repost please indicate the source. If in doubt, please contact me. I'll be appreciated.
Objective:no matter what programming language is inseparable from conditional judgment. The shell is no exception.
Copy Code code as follows:
If List Then
Do something here
Elif List Then
Do another thing
Else
Do something
Shell if judge commonly used in the green part, the tail part of the more do not understand. Reproduced from Baidu Library.
[-A file] if FILE existence is true.
[-B-file] True if file exists and is a block-specific file.
[-C file] is true if file
Java EE Development of various types of resources download list, the history of the most complete IT resources, personal collection summary.
Objective:
No matter what programming language is inseparable from conditional judgment. The shell is no
Startup script start.sh This script is used to start the project, log logs and PID#!/bin/shprg=" $" #$ A represents the current startup script # Get the true path of the file while[-H"$PRG"]; Dols= ' Ls-ld"$PRG"' link= ' Expr"$ls": ' .*-> \ (. *\) $"
[-A file] is true if file exists.[-B file] True if file exists and is a block special file.[-C file] True if file exists and is a word special.[-D file] True if file exists and is a directory.[-E File] True if file exists.[-F file] True if file
[-A file] is true if file exists.[-B file] True if file exists and is a block special file.[-C file] True if file exists and is a word special.[-D file] True if file exists and is a directory.[-E File] True if file exists.[-F file] True if file
[ -a file] is true if file exists. [ -b file] True if file exists and is a block special file. [ -c file] True if file exists and is a word special. [ -d file] True if file exists and is a directory. [ -e file] is true if file exists. [ -f file]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.