Gestionnaire de fichiers - Editer - /opt/cpanel/ea-ruby24/root/usr/share/ri/system/Pathname/cdesc-Pathname.ri
Arrière
U:RDoc::NormalClass[iI" Pathname:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[ : @fileI"!ext/pathname/lib/pathname.rb;T:0@omit_headings_from_table_of_contents_below0o;;[:o:RDoc::Markup::Paragraph;[I"LPathname represents the name of a file or directory on the filesystem, ;TI"but not the file itself.;To:RDoc::Markup::BlankLine o;;[I"GThe pathname depends on the Operating System: Unix, Windows, etc. ;TI"OThis library works with pathnames of local OS, however non-Unix pathnames ;TI""are supported experimentally.;T@o;;[I"HA Pathname can be relative or absolute. It's not until you try to ;TI"Lreference the file that it even matters whether the file exists or not.;T@o;;[I"EPathname is immutable. It has no method for destructive update.;T@o;;[I"OThe goal of this class is to manipulate file path information in a neater ;TI"Jway than standard Ruby provides. The examples below demonstrate the ;TI"difference.;T@o;;[I"Q*All* functionality from File, FileTest, and some from Dir and FileUtils is ;TI"Nincluded, in an unsurprising way. It is essentially a facade for all of ;TI"these, and more.;T@S:RDoc::Markup::Heading: leveli: textI" Examples;T@S; ;i;I"Example 1: Using Pathname;T@o:RDoc::Markup::Verbatim;[I"require 'pathname' ;TI"(pn = Pathname.new("/usr/bin/ruby") ;TI")size = pn.size # 27662 ;TI")isdir = pn.directory? # false ;TI"5dir = pn.dirname # Pathname:/usr/bin ;TI"1base = pn.basename # Pathname:ruby ;TI"Fdir, base = pn.split # [Pathname:/usr/bin, Pathname:ruby] ;TI"data = pn.read ;TI"pn.open { |f| _ } ;TI"pn.each_line { |line| _ } ;T:@format0S; ;i;I"#Example 2: Using standard Ruby;T@o;;[I"pn = "/usr/bin/ruby" ;TI")size = File.size(pn) # 27662 ;TI")isdir = File.directory?(pn) # false ;TI".dir = File.dirname(pn) # "/usr/bin" ;TI"*base = File.basename(pn) # "ruby" ;TI"8dir, base = File.split(pn) # ["/usr/bin", "ruby"] ;TI"data = File.read(pn) ;TI"File.open(pn) { |f| _ } ;TI"#File.foreach(pn) { |line| _ } ;T;0S; ;i;I" Example 3: Special features;T@o;;[I"9p1 = Pathname.new("/usr/lib") # Pathname:/usr/lib ;TI"Bp2 = p1 + "ruby/1.8" # Pathname:/usr/lib/ruby/1.8 ;TI"5p3 = p1.parent # Pathname:/usr ;TI"=p4 = p2.relative_path_from(p3) # Pathname:lib/ruby/1.8 ;TI"<pwd = Pathname.pwd # Pathname:/home/gavin ;TI",pwd.absolute? # true ;TI"2p5 = Pathname.new "." # Pathname:. ;TI"Bp5 = p5 + "music/../articles" # Pathname:music/../articles ;TI"9p5.cleanpath # Pathname:articles ;TI"Ep5.realpath # Pathname:/home/gavin/articles ;TI"Rp5.children # [Pathname:/home/gavin/articles/linux, ...] ;T;0S; ;i;I"Breakdown of functionality;T@S; ;i;I"Core methods;T@o;;[I"IThese methods are effectively manipulating a String, because that's ;TI"Eall a path is. None of these access the file system except for ;TI"F#mountpoint?, #children, #each_child, #realdirpath and #realpath.;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o;;[I"+;To;;0;[o;;[I" #join;To;;0;[o;;[I"#parent;To;;0;[o;;[I"#root?;To;;0;[o;;[I"#absolute?;To;;0;[o;;[I"#relative?;To;;0;[o;;[I"#relative_path_from;To;;0;[o;;[I"#each_filename;To;;0;[o;;[I"#cleanpath;To;;0;[o;;[I"#realpath;To;;0;[o;;[I"#realdirpath;To;;0;[o;;[I"#children;To;;0;[o;;[I"#each_child;To;;0;[o;;[I"#mountpoint?;T@S; ;i;I""File status predicate methods;T@o;;[I"-These methods are a facade for FileTest:;To;;;;[o;;0;[o;;[I"#blockdev?;To;;0;[o;;[I"#chardev?;To;;0;[o;;[I"#directory?;To;;0;[o;;[I"#executable?;To;;0;[o;;[I"#executable_real?;To;;0;[o;;[I"#exist?;To;;0;[o;;[I"#file?;To;;0;[o;;[I"#grpowned?;To;;0;[o;;[I"#owned?;To;;0;[o;;[I"#pipe?;To;;0;[o;;[I"#readable?;To;;0;[o;;[I"#world_readable?;To;;0;[o;;[I"#readable_real?;To;;0;[o;;[I" #setgid?;To;;0;[o;;[I" #setuid?;To;;0;[o;;[I" #size;To;;0;[o;;[I"#size?;To;;0;[o;;[I" #socket?;To;;0;[o;;[I" #sticky?;To;;0;[o;;[I"#symlink?;To;;0;[o;;[I"#writable?;To;;0;[o;;[I"#world_writable?;To;;0;[o;;[I"#writable_real?;To;;0;[o;;[I"#zero?;T@S; ;i;I"+File property and manipulation methods;T@o;;[I")These methods are a facade for File:;To;;;;[o;;0;[o;;[I"#atime;To;;0;[o;;[I"#birthtime;To;;0;[o;;[I"#ctime;To;;0;[o;;[I"#mtime;To;;0;[o;;[I"#chmod(mode);To;;0;[o;;[I"#lchmod(mode);To;;0;[o;;[I"#chown(owner, group);To;;0;[o;;[I"#lchown(owner, group);To;;0;[o;;[I"#fnmatch(pattern, *args);To;;0;[o;;[I"#fnmatch?(pattern, *args);To;;0;[o;;[I"#ftype;To;;0;[o;;[I"#make_link(old);To;;0;[o;;[I"#open(*args, &block);To;;0;[o;;[I"#readlink;To;;0;[o;;[I"#rename(to);To;;0;[o;;[I" #stat;To;;0;[o;;[I"#lstat;To;;0;[o;;[I"#make_symlink(old);To;;0;[o;;[I"#truncate(length);To;;0;[o;;[I"#utime(atime, mtime);To;;0;[o;;[I"#basename(*args);To;;0;[o;;[I" #dirname;To;;0;[o;;[I" #extname;To;;0;[o;;[I"#expand_path(*args);To;;0;[o;;[I"#split;T@S; ;i;I"Directory methods;T@o;;[I"(These methods are a facade for Dir:;To;;;;[o;;0;[o;;[I"Pathname.glob(*args);To;;0;[o;;[I""Pathname.getwd / Pathname.pwd;To;;0;[o;;[I"#rmdir;To;;0;[o;;[I" #entries;To;;0;[o;;[I"#each_entry(&block);To;;0;[o;;[I"#mkdir(*args);To;;0;[o;;[I"#opendir(*args);T@S; ;i;I"IO;T@o;;[I"'These methods are a facade for IO:;To;;;;[ o;;0;[o;;[I"#each_line(*args, &block);To;;0;[o;;[I"#read(*args);To;;0;[o;;[I"#binread(*args);To;;0;[o;;[I"#readlines(*args);To;;0;[o;;[I"#sysopen(*args);T@S; ;i;I"Utilities;T@o;;[I"@These methods are a mixture of Find, FileUtils, and others:;To;;;;[ o;;0;[o;;[I"#find(&block);To;;0;[o;;[I"#mkpath;To;;0;[o;;[I"#rmtree;To;;0;[o;;[I"#unlink / #delete;T@S; ;i;I"Method documentation;T@o;;[ I"SAs the above section shows, most of the methods in Pathname are facades. The ;TI"Mdocumentation for these methods generally just says, for instance, "See ;TI"MFileTest.writable?", as you should be familiar with the original method ;TI"Ianyway, and its documentation (e.g. through +ri+) will contain more ;TI"Binformation. In some cases, a brief description will follow.;T; I"ext/pathname/pathname.c;T; 0; 0; 0[ [ U:RDoc::Constant[i I"TO_PATH;FI"Pathname::TO_PATH;T00o;;[o;;[I"Oto_path is implemented so Pathname objects are usable with File.open, etc.;T; @ ; 0@ @cRDoc::NormalClass0U;[i I"SAME_PATHS;FI"Pathname::SAME_PATHS;T00o;;[ ; @ ; 0@ @@ 0U;[i I"SEPARATOR_LIST;FI"Pathname::SEPARATOR_LIST;T00o;;[ ; @ ; 0@ @@ 0U;[i I"SEPARATOR_PAT;FI"Pathname::SEPARATOR_PAT;T00o;;[ ; @ ; 0@ @@ 0[ [[I" class;T[[:public[ [I" getwd;TI"ext/pathname/pathname.c;T[I" glob;T@<[I"new;T@<[I"pwd;T@<[:protected[ [:private[ [I" instance;T[[;[d[I"+;TI"!ext/pathname/lib/pathname.rb;T[I"/;F@N[I"<=>;T@<[I"==;T@<[I"===;T@<[I"absolute?;F@N[I"ascend;F@N[I" atime;T@<[I" basename;T@<[I"binread;T@<[I" binwrite;T@<[I"birthtime;T@<[I"blockdev?;T@<[I" chardev?;T@<[I" children;F@N[I" chmod;T@<[I" chown;T@<[I"cleanpath;F@N[I" ctime;T@<[I"delete;T@<[I"descend;F@N[I"directory?;T@<[I"dirname;T@<[I"each_child;F@N[I"each_entry;T@<[I"each_filename;F@N[I"each_line;T@<[I"empty?;T@<[I"entries;T@<[I" eql?;T@<[I"executable?;T@<[I"executable_real?;T@<[I"exist?;T@<[I"expand_path;T@<[I"extname;T@<[I" file?;T@<[I" find;F@N[I"fnmatch;T@<[I" fnmatch?;T@<[I"freeze;T@<[I" ftype;T@<[I"grpowned?;T@<[I" join;F@N[I"lchmod;T@<[I"lchown;T@<[I" lstat;T@<[I"make_link;T@<[I"make_symlink;T@<[I" mkdir;T@<[I"mkpath;F@N[I"mountpoint?;F@N[I" mtime;T@<[I" open;T@<[I"opendir;T@<[I"owned?;T@<[I"parent;F@N[I" pipe?;T@<[I" read;T@<[I"readable?;T@<[I"readable_real?;T@<[I"readlines;T@<[I" readlink;T@<[I"realdirpath;T@<[I" realpath;T@<[I"relative?;F@N[I"relative_path_from;F@N[I"rename;T@<[I" rmdir;T@<[I"rmtree;F@N[I" root?;F@N[I"setgid?;T@<[I"setuid?;T@<[I" size;T@<[I" size?;T@<[I"socket?;T@<[I" split;T@<[I" stat;T@<[I"sticky?;T@<[I"sub;T@<[I"sub_ext;T@<[I" symlink?;T@<[I"sysopen;T@<[I" taint;T@<[I"to_path;T@<[I" to_s;T@<[I" truncate;T@<[I"unlink;T@<[I"untaint;T@<[I" utime;T@<[I"world_readable?;T@<[I"world_writable?;T@<[I"writable?;T@<[I"writable_real?;T@<[I" write;T@<[I" zero?;T@<[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0; 0[@ @@cRDoc::TopLevel
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0.01 |
proxy
|
phpinfo
|
Réglages