Lines Matching +defs:orig +defs:file +defs:name

3   file.c -
15 #include "missing/file.h"
34 # include <sys/file.h>
145 file_path_convert(VALUE name)
148 rb_encoding *fname_encoding = rb_enc_from_index(ENCODING_GET(name));
154 && !rb_enc_str_asciionly_p(name)) {
157 name = rb_str_conv_enc(name, fname_encoding, fs_encoding);
160 return name;
168 rb_raise(rb_eEncCompatError, "path name must be ASCII-compatible (%s): %"PRIsVALUE,
268 * file.path -> filename
270 * Returns the pathname used to create <i>file</i> as a string. Does
271 * not normalize the name.
603 * Returns the native file system's block size. Will return <code>nil</code>
624 * Returns the number of native file system blocks allocated for this
625 * file, or <code>nil</code> if the operating system doesn't
721 * Returns the last access time for this file as an object of class
755 * directory information about the file was changed, not the file
790 const char *name;
824 rb_str_buf_cat2(str, member[i].name);
844 rb_stat(VALUE file, struct stat *st)
849 tmp = rb_check_convert_type(file, T_FILE, "IO", "to_io");
856 FilePathValue(file);
857 file = rb_str_encode_ospath(file);
858 return STAT(StringValueCStr(file), st);
863 w32_io_info(VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
868 tmp = rb_check_convert_type(*file, T_FILE, "IO", "to_io");
882 FilePathValue(*file);
883 tmp = rb_str_encode_ospath(*file);
907 * Returns a <code>File::Stat</code> object for the named file (see
989 * file.lstat -> stat
1091 /* Root can read or write any file. */
1095 /* Root can execute any file that has any one of the execute
1121 * <code>FileTest</code> implements file test operations similar to
1134 * Returns <code>true</code> if the named file is a directory,
1161 * Returns <code>true</code> if the named file is a pipe.
1187 * Returns <code>true</code> if the named file is a symbolic link.
1224 * Returns <code>true</code> if the named file is a socket.
1260 * Returns <code>true</code> if the named file is a block device.
1290 * Returns <code>true</code> if the named file is a character device.
1314 * Return <code>true</code> if the named file exists.
1318 * "file exists" means that stat() or fstat() system call is successful.
1334 * Returns <code>true</code> if the named file is readable by the effective
1352 * Returns <code>true</code> if the named file is readable by the real
1379 * representing the file permission bits of <i>file_name</i>. Returns
1408 * Returns <code>true</code> if the named file is writable by the effective
1426 * Returns <code>true</code> if the named file is writable by the real
1445 * representing the file permission bits of <i>file_name</i>. Returns
1474 * Returns <code>true</code> if the named file is executable by the effective
1492 * Returns <code>true</code> if the named file is executable by the real
1512 * File.file?(file_name) -> true or false
1514 * Returns <code>true</code> if the named file exists and is a
1515 * regular file.
1534 * Returns <code>true</code> if the named file exists and has
1555 * file otherwise.
1574 * Returns <code>true</code> if the named file exists and the
1576 * the file.
1605 * Returns <code>true</code> if the named file exists and the
1607 * the file. Returns <code>false</code> on Windows.
1643 * Returns <code>true</code> if the named file has the setuid bit set.
1660 * Returns <code>true</code> if the named file has the setgid bit set.
1677 * Returns <code>true</code> if the named file has the sticky bit set.
1784 t = "file";
1823 * Identifies the type of the named file; the return string is one of
1824 * ``<code>file</code>'', ``<code>directory</code>'',
1829 * File.ftype("testfile") #=> "file"
1853 * Returns the last access time for the named file as a Time object).
1875 * file.atime -> time
1878 * for <i>file</i>, or epoch if <i>file</i> has not been accessed.
1901 * Returns the modification time for the named file as a Time object.
1923 * file.mtime -> time
1925 * Returns the modification time for <i>file</i>.
1948 * Returns the change time for the named file (the time at which
1949 * directory information about the file was changed, not the file
1974 * file.ctime -> time
1976 * Returns the change time for <i>file</i> (that is, the time directory
1977 * information about the file was changed, not the file itself).
2000 * file.size -> integer
2002 * Returns the size of <i>file</i> in bytes.
2035 * Changes permission bits on the named file(s) to the bit pattern
2062 * file.chmod(mode_int) -> 0
2064 * Changes permission bits on <i>file</i> to the bit pattern
2113 * not the file referenced by the link). Often not available.
2152 * Changes the owner and group of the named file(s) to the given
2154 * privileges may change the owner of a file. The current owner of a
2155 * file may change the file's group to any group to which the owner
2191 * file.chown(owner_int, group_int ) -> 0
2193 * Changes the owner and group of <i>file</i> to the given numeric
2195 * change the owner of a file. The current owner of a file may change
2196 * the file's group to any group to which the owner belongs. A
2245 * file referenced by the link). Often not available. Returns number
2389 * named file to the first two arguments. Returns
2390 * the number of file names in the argument list.
2439 * Creates a new name for an existing file using a hard link. Will not
2470 * Creates a symbolic link called <i>new_name</i> for the existing file
2503 * Returns the name of the file referenced by the given link.
2579 * Renames the given file to the new name. Raises a
2580 * <code>SystemCallError</code> if the file cannot be renamed.
2629 * file read-only for everyone.
3061 /* we need to get the drive letter or UNC share name */
3372 * it is NOT expanded, it is treated as a normal directory name.
3655 ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encoding *enc)
3663 end = name + (alllen ? (size_t)*alllen : strlen(name));
3664 name = skipprefix(name, end, enc);
3666 root = name;
3668 while (isdirsep(*name))
3669 name++;
3670 if (!*name) {
3671 p = name - 1;
3674 if (name != root) {
3691 if (!(p = strrdirsep(name, end, enc))) {
3692 p = name;
3736 const char *name, *p;
3749 if ((n = RSTRING_LEN(fname)) == 0 || !*(name = RSTRING_PTR(fname)))
3752 p = ruby_enc_find_basename(name, &f, &n, enc);
3795 const char *name, *root, *p, *end;
3800 name = StringValueCStr(fname);
3801 end = name + RSTRING_LEN(fname);
3803 root = skiproot(name, end, enc);
3805 if (root > name + 1 && isdirsep(*name))
3806 root = skipprefix(name = root - 2, end, enc);
3808 if (root > name + 1)
3809 name = root - 1;
3815 if (p == name)
3818 if (has_drive_letter(name) && isdirsep(*(name + 2))) {
3819 const char *top = skiproot(name + 2, end, enc);
3820 dirname = rb_str_new(name, 3);
3825 dirname = rb_str_new(name, p - name);
3827 if (has_drive_letter(name) && root == name + 2 && p - name == 2)
3838 * returned pointer is in ``name'' or NULL.
3848 ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
3850 const char *p, *e, *end = name + (len ? *len : (long)strlen(name));
3852 p = strrdirsep(name, end, enc); /* get the last path component */
3854 p = name;
3856 do name = ++p; while (isdirsep(*p));
3890 if (!e || e == name)
3904 * Returns the extension (the portion of file name in +path+
3925 const char *name, *e;
3930 name = StringValueCStr(fname);
3932 e = ruby_enc_find_extname(name, &len, rb_enc_get(fname));
3935 extname = rb_str_subseq(fname, e - name, len); /* keep the dot, too! */
3961 * Splits the given string into a directory and a file component and
3992 const char *name, *tail;
4039 RSTRING_GETMEM(result, name, len);
4044 tail = chompdirsep(name, name + len, rb_enc_get(result));
4046 rb_str_set_len(result, tail - name);
4085 * Truncates the file <i>file_name</i> to be at most <i>integer</i>
4132 * file.truncate(integer) -> 0
4134 * Truncates <i>file</i> to at most <i>integer</i> bytes. The file
4206 * file.flock(locking_constant) -> 0 or false
4208 * Locks or unlocks a file according to <i>locking_constant</i> (a
4217 * | exclusive lock for a given file at a time.
4223 * | shared lock for a given file at the same time.
4230 * # don't use "w" because it truncates the file before lock.
4316 * File tests on a single file:
4325 * "f" | boolean | True if file1 exists and is a regular file
4340 * "R" | boolean | True if file is readable by the real
4512 * created; changes made to the file after that point will not be
4531 * Create a File::Stat object for the given file name (raising an
4532 * exception if the file doesn't exist).
4559 rb_stat_init_copy(VALUE copy, VALUE orig)
4563 if (!OBJ_INIT_COPY(copy, orig)) return copy;
4568 if (DATA_PTR(orig)) {
4570 *nst = *(struct stat*)DATA_PTR(orig);
4582 * ``<code>file</code>'', ``<code>directory</code>'',
4685 * Returns <code>true</code> if the file is a block device,
4708 * Returns <code>true</code> if the file is a character device,
4842 * representing the file permission bits of <i>stat</i>. Returns
4934 * representing the file permission bits of <i>stat</i>. Returns
5026 * stat.file? -> true or false
5028 * Returns <code>true</code> if <i>stat</i> is a regular file (not
5029 * a device file, pipe, socket, etc.).
5031 * File.stat("testfile").file? #=> true
5046 * Returns <code>true</code> if <i>stat</i> is a zero-length file;
5144 rb_file_const(const char *name, VALUE value)
5146 rb_define_const(rb_mFConst, name, value);
5288 copy_path_class(VALUE path, VALUE orig)
5290 RBASIC(path)->klass = rb_obj_class(orig);
5314 rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
5386 rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
5430 rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
5437 define_filetest_function(const char *name, VALUE (*func)(ANYARGS), int argc)
5439 rb_define_module_function(rb_mFileTest, name, func, argc);
5440 rb_define_singleton_method(rb_cFile, name, func, argc);
5456 * A <code>File</code> is an abstraction of any file object accessible
5464 * set of bits that indicate permissions of a file. On Unix-based
5468 * file:
5473 * file (plain, directory, pipe, socket, and so on) and various other
5479 * make a file read-only or read-write. In this case, the remaining
5483 * all others. The only change that can be made is to make the file
5504 define_filetest_function("file?", rb_file_file_p, 1);
5586 * File::Constants provides file-related constants. All possible
5587 * file constants are listed in the documentation but they may not all
5607 /* create file if it does not exist */
5609 /* error if CREAT and the file exists */
5650 /* Try to minimize cache effects of the I/O to and from this file. */
5710 rb_define_method(rb_cStat, "file?", rb_stat_f, 0);