The code is as follows:Copy code Import java. awt .*;Import java. awt. event .*;Import java. io .*;Import javax. swing .*;// Create, delete, and rename directories and filesPublic class FileUseDemo extends JFrame {JTextField jtfPath;Public FileUseDemo (){Super ("creating, deleting, and renaming directories and files"); // call the parent class constructorJtfPath = new JTextField (16); // input
Relative path and absolute pathAbsolute path: The way the path is written (must be from the root directory/write), for example:/usr/share/doc this directory.Relative path: The way the path is written (not by/written), for example, by/usr/share/doc to the bottom of the/usr/share/man, you can write: CD. /man, this is how the relative path is written.Related Operations for DirectoriesIt is important to note that there are two directories under all
Today we are going to get to know the directories and paths in Linux and some common commands for manipulating them.Speaking of the path there is absolute and relative points, although simple, we would like to say again:
Absolute path, from the root directory of the system/starting directory is a relative path, such as/usr/bin,/usr/local
Relative paths, paths not starting from the root are relative paths, such as./foo.sh, Foo/bar.txt
Permissions for directories and usersFirst, Linuxfile permissions in the system1.1 Linuxthree basic permissions in the system• Definition of file permissions: Access control for a file or directory (Access restrictions)• Three attributes of a file:Owner of the User (master): When the user creates a file, the default user is the master of the file.User group owner (group): The user's primary group is the group of this fileL Others: not the above two.Fo
Applied to: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1
You can use command-line scripting Iisftpdr.vbs (stored in systemroot\system32) to list the FTP virtual directories on a local or remote computer running a member of the Windows Server 2003 family with IIS 6.0.
The/query operation displays only the virtual directory and does not display the physical directory. Also, it displays only virtual
and can be viewed directly:>>> Os.environ{' versioner_python_prefer_32_bit ': ' No ', ' term_program_version ': ' 326 ', ' LOGNAME ': ' Michael ', ' USER ': ' Michael ', ' PATH ': '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/x11/bin:/usr/local/mysql/bin ', ...}To get the value of an environment variable, you can call the Os.getenv () function:>>> os.getenv (' PATH ')'/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/x11/bin:/usr/local/mysql/bin 'manipulating files and directoriesNote that
Be sure to note the two directories in the folder---->. (current directory): (parent directory) needs to be filtered for both directories,Otherwise the deletion or traversal is always, for the. It even loops through the parent directory of the folder you specify, deleting important filesfunctionDealfileindir ($path,$type=false){ if(Is_dir($path)){ if($DP=Opendir($path)){ while(false!==
The Web site file directory listing is similar to the following figure, such as the display, this effect, by default, can be displayed, the new host can be purchased by default in the form of a list of files displayed:
Index Manager
The index Manager allows you to customize the way you view directories on the network. You can choose the default style, no index, or two types of indexes. If you don't want people to see the files in your directory, s
There's a difference. The
/lib gives a library file of the root and the kernel required so or a, and/usr/lib is available to ordinary users.
There are two modes of Linux program, which you should know, is User mode and kernel mode, and this is also related to, no longer redundant.
differences between ================/lib and/usr/lib and/usr/local/lib (ZZ) article classification: Operating system
Simply put,/lib is kernel-level,/usr/lib is system-level,/usr/local/lib is user-level.
/lib/-contai
When making a startup disc, some files or directories are placed directly in the directory of the CD-ROM, only related to the CD boot, such as the boot and Ucdos directory in the worry-free boot ISO, the boot sector file Wprosect.dat,wsrvsect.dat in multiple-boot ISO, Adsrsect.dat, boot directory wpro,wsrv,asrv, these things in Windows is not needed, put in there not only affect the beautiful, not easy to use, how to do?The best way to do this is to h
Tags: directory/etc pass/usr/etc/Process blog capitalization owntime:18.03.26The following 2 typical files and directories are analyzed: ll /usr/bin/passwd -rwsr-xr-x. 1 root root 27832 Jan 29 2014 /usr/bin/passwdll -d /tmpdrwxrwxrwt. 23 root root 4096 Mar 25 23:53 /tmpSUIDWhen it s appears on the permissions of the owner of the file x , such as the permissions of the file we see above, this is referred to as the /usr/bin/passwd -rwsr-xr-x SET UID ab
Tags: Linux directory7.7 "Linux learning is not difficult" file/directory Management (7): rmdir command to delete empty directoriesUse the rmdir command to remove an empty directory from a Linux system.Command syntax:rmdir [Options] [contents]The meanings of the options in the command are as shown in the table.
Options
option meaning
-P
Delete directories recursively, and when subdirectories are deleted, their
Tags: usr set linux system home directory relative path using transform Linux system Management CreateUsage: CD [directory path]Transform working directory to make directory path, if [directory path] parameter is omitted to transform to user's home directory, where [directory path] can be absolute path or relative pathIn addition, "~" in Bash represents the current user home directory, "." means the current directory "." indicates the current directory of the previous level of directory, "-" ind
Tags: regular time_t catalog Perm spec SYS one off open1. PrefaceWork involves file systems, and sometimes it is necessary to determine whether files and directories exist. I combined apue fourth chapter file and directory, summed up how to correctly determine the existence of files and directories, easy to query later.2. Stat Series functionThe stat function is used to return the structure information asso
This is not about how to solve the problem of path rewriting or how to configure, but rather to explain the concept and role of site, application (application) and virtual directory (VM), and the similarities and differences between these three things in IIS6 and IIS7. Because sites, applications, and virtual directories are sure to be encountered when we build websites on IIS, their concepts are so vague (at least for me). I found some information on
deleting files and directories in PHP is actually very simple as long as two functions one is unlink a rmdir function, if you want to implement delete directories and directories under the file we need to use the recursive operation. This article mainly introduces the PHP Unlink and rmdir Delete directory and directory of all the file instance code, the need for
Description: The/home directory contains the data directory, the data directory contains a, B, C, D, e five directories, now to the data directory in addition to the E directory in all directories except for the/bak directory system operations www.osyunwei.com Warm reminder: qihang01 original content copyright, reproduced please specify the source and the original link method one: Terminal command line exec
1) root directory "/"The root directory is located at the top level of the directory structure, denoted by a slash (/), similar to the "C: \" of the Windows operating system, and contains all the directories and files in the Fedora operating system.2)/binThe/bin directory, also known as a binary directory, contains binary images of important Linux commands used by system administrators and ordinary users. This directory contains a variety of executabl
Summary:
File manipulation is a very basic and important part of the program, while paths, files, directories, and I/O are common themes in file operations, here's a summary of these common issues, and try to provide solutions to every problem, even without the answers you want, and hopefully provide you with some helpful ideas, If you have good suggestions, please be able to leave a message to make these content more perfect.
Main content:
The rel
Security context for files and directories (involving some file systems)When we hit a command to initiate a process to operate (read, copy, modify, delete, etc.) a directory or file, the process is executed according to our identity (owner of the directory, group, others), the owner of the directory or file, the group and other permissions. The process can execute only if we have the appropriate permissions for the directory. Processes are in order wh
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.