Transferred from: http://www.cnblogs.com/alan-forever/p/3721908.htmlThe current working directory can be obtained by GETCWD ().1 #include 2 3 char *getcwd (char *cwdbuf, size_t size);A successful call returns a pointer to Cwdbuf, and the failure
You can use getcwd () to obtain the current working directory.
1 #include 2 3 char *getcwd(char *cwdbuf, size_t size);
If the call succeeds, a pointer to cwdbuf is returned. If the call fails, NULL is returned.
The implementation of getcwd () is
Find current directory The char *getcwd (char * buf,size_t size) getcwd function copies the absolute pathname of the current working directory to BUF, which indicates the size of the BUF if BUF is not large enough, The entire pathname cannot be
In addition to network communication, the server program must also take into account many other details of the problem, fragmented, but basically the template-style. ——— cited
Linux server programs typically run in the background. Daemon is
The previous article is the file operation (chapter III), the code in the article in the file operation (code download).3.6 formatted output and input 3.6.1 printf, fprintf, and sprintf functions printf functions are capable of formatting and
1 Directory operations Change the access rights of a directory or a file#include int chmod (constchar//mode like 0777The file specified by the path parameter is modified to have access rights given by the mode parameter.When the Modify permission
" http://990487026.blog.51cto.com " Linux system Development file operation Ext2 File System Understanding Stat () function access () function chmod () function utime () function truncate () function link () Hard link function symlink () Soft
Personal environment: ubuntu10.04, xp, 8.0.1 virtual machine, Master/Slave machine, and s3c2410
From: http://blog.chinaunix.net/uid-24856020-id-2559041.html
The remote debugging method based on gdb and gdbsever is described here. Environment: PC:
Python OS module and Pythonos ModulePython OS Module 1. OS. getcwd ()
Obtain the current working directory.
ImportOS
Print (OS. getcwd () # I: \ Python ProgramIi. OS. chdir ('path ')
Change the working directory of the current script. It is
The recent write code has a need to traverse every file in the directory and get the absolute path to the file,We know that there are system commands in Linux C + + so I made a log in the code, and then I read each line of the log file, and then I
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.