Catalog 1, get current directory--OS.GETCWD () >>> import os>>> s=os.getcwd () #获得当前运行脚本所在目录 >>> s ' c:\\python27 ' For example, if you run test.py, entering the command returns the folder location where the script is located. For example, put
??The first inference is whether the Hkey_local_machine\system\currentcontrolset\control\update\updatemode value in the Register table is 0, and if 1 indicates a manual refresh, the value of 0 indicates that it is actively refreshed. If it is not
1. Common Nsfilemanager File methods-(NSData *) Contentsatpath:path//Read data from a file-(BOOL) Createfileatpath:path contents: (NSData *) data attributes:attr//write to a file-(BOOL) Removeitematpath:path error:err//Delete a file-(BOOL)
1 Stat,fstat,lstat function#include int stat (constcharstruct stat *restrict buf); int fstat (intstruct stat * buf); int lstat (constcharstruct stat *restrict buf);Successful return 0, failure return-1Stat Returns the information structure of the
Link, unlink, remove and rename
A file can have multiple directory entries pointing to its I node. Use the link function to create a link to an existing file
#include int link(const char *existingpath, const char *newpath);返回值:成功为0,出错为-
One, apue the various obscure nouns in this chapterI was reading this chapter encountered a variety of ID, according to the name is completely unclear what meaning, fortunately see this article, http://blog.csdn.net/ccjjnn19890720/article/details/699
13. Function Rename and Renameat#include int rename (constcharconstChar *newname); int renameat (intconstcharintconstChar * newname);The file or directory can be renamed with the Rename function or the Renameat function. There are several situations
Files and directoriesRealizeLs-l1.Stat ();Fstat ();Lstat ();2. Type of file (St_mode)dbcpls-D: CatalogueB: Block deviceC: Character deviceP: PipingL: Symbolic LinkS: Socket-: Normal file3. Permissions for files (st_mode)RwxU+s:u must have x
The Umask function creates a masking word for the process settings file mode and returns the previous value, which is one of the few return functions that have no errors. Where Cmask is composed of several bitwise "or" in 9 constants (S_IR/W/XUSR, S_
01. Single-User operating system and multi-user operating system
Single User operating system : A computer can only be used by one user at a time, and a user will be able to enjoy all the hardware and software resources of the system alone.
This article explains three questions: 1 How to pass parameters to the map and reduce functions when writing a mapreduce program using Java. 2 How to use streaming to write a mapreduce program (c + +, Shell, Python), how to map, reduce scriptPassing
First, IntroductionThe basic functions of performing I/O in the previous chapter (opening files, reading files, and writing files), this chapter describes the other characteristics of the file system and the nature of the files, we will start with
Every time I can't remember, send an article to record.Direct RM is available, but add two parameters-rf that is: RM-RF directory name-R is recursive down, no matter how many levels of directory, delete-F is directly forcibly deleted, without any
This section is mainly about directory operations, involving the creation of directories, deleting directories, reading directories, etc.1 mkdir and RmDirCreate a directory with mkdir and delete the directory with rmdir.#include int mkdir (const
File Structure stat--The following three functions can obtain status information for a file:#include intstat*pathstat*buf);int fstat(intstat*buf);intlstat*pathstat*buf);The stat function specifies the file path, Fstat Specifies the file descriptor,
/* My program in foreign Srever, my own program to store where, I am very difficult to remember.
So made up a simple directory recursive function, view my program, very convenient.
*/
function tree ($directory)
{
$mydir =dir ($directory);
echo "
"
Why the domain name definition to a directory, a directory above the files and directories can not be viewed through the address bar
When doing a PHP server, the domain name's virtual directory is defined as
A directory, then the directory and files
Switch directory CD under LinuxView the contents of the current directory under Linux LS, LL, ls-alHow to display the directory path where the current command is located pwdCreate a directory under Linux mkdirCreate a file under Linux direct vim
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.