Package org.jruby
Class RubyFile
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyIO
org.jruby.RubyFile
- All Implemented Interfaces:
Closeable,Flushable,Serializable,AutoCloseable,Cloneable,Comparable<IRubyObject>,InstanceVariables,InternalVariables,IRubyObject,EncodingCapable,CoreObjectType,IOEncodable
- Direct Known Subclasses:
Tempfile
The Ruby File class.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.RubyIO
RubyIO.SysopenNested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.FinalizerNested classes/interfaces inherited from interface org.jruby.util.io.IOEncodable
IOEncodable.ConvConfig -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final ByteListprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intstatic final intstatic final intstatic final intstatic final intprivate static final intprotected StringDeprecated.(package private) static final Patternprivate static final Patternprivate static final Patternprivate static final long(package private) static final ByteListprivate static final String[]private static final Patternprivate static final StringFields inherited from class org.jruby.RubyIO
ALL_SPAWN_OPTIONS, CLOSED_STREAM_MSG, FD_CLOEXEC, openFile, PARAGRAPH_SEPARATOR, popenSpecial, UNSUPPORTED_SPAWN_OPTIONSFields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORFields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUST_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStampFields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IRubyObjectabsolute_path(ThreadContext context, IRubyObject recv, IRubyObject[] args) ---------------------------------------------------- File::absolute_path File.absolute_path(file_name [, dir_string] ) -> abs_file_name From Ruby 1.9.1 ------------------------------------------------------------------------ Converts a pathname to an absolute pathname.private static StringadjustPostFixDotDot(String postFix) (package private) static StringadjustRootPathOnWindows(Ruby runtime, String path, String dir) private static StringBuilderappendSlash(CharSequence canonicalPath) atime(ThreadContext context) static IRubyObjectatime(ThreadContext context, IRubyObject recv, IRubyObject filename) static RubyStringbasename(ThreadContext context, IRubyObject recv, IRubyObject path) static IRubyObjectbasename(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated.static RubyStringbasename(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject ext) private static RubyStringbasenameImpl(ThreadContext context, RubyClass klass, IRubyObject path, IRubyObject ext) birthtime(ThreadContext context) static IRubyObjectbirthtime(ThreadContext context, IRubyObject recv, IRubyObject filename) private static CharSequencecanonicalize(CharSequence canonicalPath, String remaining) static Stringcanonicalize(String path) private static StringcanonicalizePath(String path) private static StringcanonicalNormalized(CharSequence realPath) private voidcheckClosed(ThreadContext context) private static RubyStringcheckHome(ThreadContext context) Check if HOME environment variable is not nil nor emptychmod(ThreadContext context, IRubyObject arg) static IRubyObjectchmod(ThreadContext context, IRubyObject recv, IRubyObject[] args) private static intchomp(StringBuilder buffer) chown(ThreadContext context, IRubyObject arg1, IRubyObject arg2) static IRubyObjectchown(ThreadContext context, IRubyObject recv, IRubyObject[] args) private static StringconcatStrings(String s1, CharSequence s2, String s3) private static long[]convertTimespecToTimeval(long[] timespec) Converts a timespec (array of 2 longs: seconds and nanoseconds from epoch) into a timeval (array of 2 longs: seconds and microseconds from epoch).private static StringcountSlashes(String stringToCheck) Returns a string consisting ofn-1slashes, wherenis the number of slashes at the beginning of the input string.static RubyClasscreateFileClass(Ruby runtime) ctime(ThreadContext context) static IRubyObjectctime(ThreadContext context, IRubyObject recv, IRubyObject filename) static IRubyObjectdelete(ThreadContext context, IRubyObject recv, IRubyObject[] args) private static booleandir_fnmatch(ByteList pattern, ByteList path, int flags) static Stringdirname(ThreadContext context, String filename) static IRubyObjectdirname(ThreadContext context, IRubyObject recv, IRubyObject arg) private static RubyStringdoJoin(ThreadContext context, IRubyObject recv, IRubyObject[] args) static IRubyObjectexpand_path(ThreadContext context, IRubyObject recv, IRubyObject... args) Converts a pathname to an absolute pathname.static IRubyObjectexpand_path19(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated.static StringexpandPath(ThreadContext context, String relativePath, org.jcodings.Encoding[] enc, String cwd, boolean expandUser, boolean canonicalize) (package private) static RubyStringexpandPathInternal(ThreadContext context, RubyString path, RubyString wd, boolean expandUser, boolean canonicalize) private static RubyStringexpandPathInternal(ThreadContext context, IRubyObject[] args, boolean expandUser, boolean canonicalize) static StringexpandUserPath(ThreadContext context, String path) This method checks a path, and if it starts with ~, then it expands the path to the absolute path of the user's home directory.static StringexpandUserPath(ThreadContext context, String path, boolean raiseOnRelativePath) static IRubyObjectextname(ThreadContext context, IRubyObject recv, IRubyObject arg) Returns the extension name of the file.private static long[]extractTimespec(ThreadContext context, IRubyObject value) Extract a timespec (an array of 2 longs: seconds and nanoseconds from epoch) from an IRubyObject.static JRubyFilefile(IRubyObject pathOrFile) Deprecated.fileOpenGeneric(ThreadContext context, IRubyObject filename, int oflags, int fmode, IOEncodable convConfig, int perm) private static RubyStringfilePathConvert(ThreadContext context, RubyString path) static FileResourcefileResource(IRubyObject pathOrFile) Get the fully-qualified JRubyFile object for the path, taking into account the runtime's current directory.static FileResourcefileResource(ThreadContext context, IRubyObject pathOrFile) Get the fully-qualified JRubyFile object for the path, taking into account the runtime's current directory.flock(ThreadContext context, IRubyObject operation) static IRubyObjectfnmatch(ThreadContext context, IRubyObject recv, IRubyObject[] args) Returns true if path matches against pattern The pattern is not a regular expression; instead it follows rules similar to shell filename globbing.static IRubyObjectftype(ThreadContext context, IRubyObject recv, IRubyObject filename) static RubyStringget_path(ThreadContext context, IRubyObject path) static StringgetAdjustedPath(ThreadContext context, IRubyObject fileOrPath) static StringgetAdjustedPath(ThreadContext context, IRubyObject fileOrPath, String currentDirectory) private static intgetAltSeparatorChar(RubyClass File) static final FileTimegetBirthtimeWithNIO(String pathString) private static StringgetDecodedPath(ThreadContext context, IRubyObject pathOrFile) static ZipEntrygetDirOrFileEntry(String jar, String path) Deprecated.static ZipEntrygetDirOrFileEntry(ZipFile jar, String path) Deprecated.org.jcodings.Encodingprivate static ZipEntrygetFileEntry(ZipFile jar, String path, String prefixForNoEntry) private static StringgetPath()private static intgetSeparatorChar(RubyClass File) (package private) final longgetSize(ThreadContext context) initialize(ThreadContext context, IRubyObject[] args, Block block) initialize19(IRubyObject[] args, Block block) Deprecated.final IRubyObjectinspect()rb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj.inspect(ThreadContext context) private static booleanisAbsolutePath(String path) private static booleanisDirSeparator(char c) private static booleanisLocalURI(String canonicalPathString) private static booleanisSymlink(ThreadContext context, JRubyFile file) private static booleanisWindowsDriveLetter(char c) static RubyStringjoin(ThreadContext context, IRubyObject recv, IRubyObject[] args) private static booleanjoinImpl(StringBuilder buffer, String separator, ThreadContext context, IRubyObject recv, RubyArray args) private static StringBuilderjoinImplInspecting(String separator, ThreadContext context, IRubyObject recv, RubyArray parent, RubyArray array) static IRubyObjectlchmod(ThreadContext context, IRubyObject recv, IRubyObject[] args) static IRubyObjectlchown(ThreadContext context, IRubyObject recv, IRubyObject[] args) static IRubyObjectlink(ThreadContext context, IRubyObject recv, IRubyObject from, IRubyObject to) lstat(ThreadContext context) static IRubyObjectlstat(ThreadContext context, IRubyObject recv, IRubyObject filename) static IRubyObjectlutime(ThreadContext context, IRubyObject recv, IRubyObject[] args) static IRubyObjectmkfifo(ThreadContext context, RubyString path, int mode) static IRubyObjectmkfifo(ThreadContext context, IRubyObject recv, IRubyObject path) static IRubyObjectmkfifo(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject mode) mtime(ThreadContext context) static IRubyObjectmtime(ThreadContext context, IRubyObject recv, IRubyObject filename) protected IRubyObjectopenFile(ThreadContext context, IRubyObject[] args) path(ThreadContext context) static IRubyObjectpath(ThreadContext context, IRubyObject self, IRubyObject str) protected IRubyObjectrbIoClose(ThreadContext context) static IRubyObjectreadlink(ThreadContext context, IRubyObject recv, IRubyObject path) static IRubyObjectrealdirpath(ThreadContext context, IRubyObject recv, IRubyObject[] args) static IRubyObjectrealpath(ThreadContext context, IRubyObject recv, IRubyObject path) static IRubyObjectrealpath(ThreadContext context, IRubyObject recv, IRubyObject[] args) static IRubyObjectrealpath(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject cwd) static IRubyObjectrename(ThreadContext context, IRubyObject recv, IRubyObject oldName, IRubyObject newName) private static Stringreplace(String str, CharSequence target, CharSequence replace) voidsetEncoding(org.jcodings.Encoding encoding) private voidprivate static JavaSites.FileSitessites(ThreadContext context) size(ThreadContext context) static RubyArraysplit(ThreadContext context, IRubyObject recv, IRubyObject arg) static String[](package private) static booleanstatic booleanstatic IRubyObjectstat(ThreadContext context, IRubyObject recv, IRubyObject filename) static IRubyObjectsymlink(ThreadContext context, IRubyObject recv, IRubyObject from, IRubyObject to) <T> TConvert the object to the specified Java class, if possible.toString()The default toString method is just a wrapper that calls the Ruby "to_s" method.truncate(ThreadContext context, IRubyObject len) static IRubyObjecttruncate(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2) static IRubyObjecttruncate19(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2) private static IRubyObjecttruncateCommon(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2) static IRubyObjectumask(ThreadContext context, IRubyObject recv, IRubyObject[] args) static IRubyObjectunlink(ThreadContext context, IRubyObject... args) static IRubyObjectunlink(ThreadContext context, IRubyObject recv, IRubyObject[] args) static IRubyObjectutime(ThreadContext context, IRubyObject recv, IRubyObject[] args) Methods inherited from class org.jruby.RubyIO
addBlockingThread, adviceArgCheck, advise, autoclose, autoclose_set, binmode, binread, binwrite, bytes, chars, chars19, checkExecEnv, checkExecOptions, checkLength, checkPopenOptions, checkSpawnOptions, checkUnsupportedOptions, checkValidSpawnOptions, cloexecOpen, close, close, close_on_exec_p, close_on_exec_set, close_read, close_write, closed_p, codepoints, convertToIO, copy_stream, createIOClass, doRead, doReadNonblock, doWriteNonblock, each, each, each, each, each, each_byte, each_byteInternal, each_char, each_char19, each_charInternal, each_codepoint, each_line, each_line, each_line, each_line, each_line, ensureYieldClose, ensureYieldClosePipes, eof_p, external_encoding, failIfDirectory, fcntl, fcntl, fileno, flush, flush, flushRaw, for_fd, foreach, fsync, getBlocking, getBOM, getbyte, getByte, getc, getc, getc19, getChannel, getEcflags, getEcopts, getEnc, getEnc2, getInputEncoding, getInStream, getIOModes, getIOModesIntFromString, getline, getline, getline, getline, getline, getline, getNativeClassIndex, getOpenFile, getOpenFileChecked, getOpenFileInitialized, getOutStream, getPartial, getReadEncoding, gets, gets, gets, gets, getSync, GetWriteIO, initialize, initialize, initialize, initialize_copy, internal_encoding, ioClose, ioctl, ioOpen, ioOpen, ioOpen, ioStaticWrite, isAutoclose, isClosed, lineno, lineno_set, lines, lines19, MakeOpenFile, newInstance, newIO, newIOOptions, newIOOptions, newIOOptions, newIOOptions, newIOOptions, newModeFlags, newModeFlags, newModeFlags, nonblockEOF, obliterateProcess, op_append, op_binmode, open, parseIOOptions, pid, pipe, pipe, pipe19, pipe19, pipe19, popen, popen3, popen4, popenSpecial, pos, pos_set, pread, pread, prepStdio, prepStdio, print, print, printf, putc, putc, puts, puts, puts, puts, puts, puts, puts0, puts1, puts2, puts3, pwrite, read, read, read, read, read, read, read, read_nonblock, read19, readbyte, readchar, readchar, readline, readline, readline, readlines, readlines, readlines, readlines, readlines, readlines, readlines19, readlines19, readpartial, removeBlockingThread, reopen, reopenIO, rewind, seek, seek, seek, seekBeforeAccess, select, select_static, set_encoding, set_encoding, set_encoding, setAscii8bitBinmode, setAutoclose, setBlocking, setBOM, setEcflags, setEcopts, setEnc, setEnc2, setEncoding, setSync, stat, sync, sync_set, sysopen, sysopen, sysopen, sysopen19, sysread, sysseek, syswrite, to_io, tryConvert, tty_p, ungetbyte, ungetc, updateIOOptionsFromOptions, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write_nonblock, writeStaticMethods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, dig1, dig2, eqlInternal, equalInternal, equals, hashCode, inspect, op_eqq, puts, specificEval, toRubyStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, defaultToJava, display, dup, ensureInstanceVariablesSettable, eql, eql_p, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, infectBy, infectBy, initialize, initialize19, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method, method_missing, method_missing19, method19, methods, methods, methods19, methodsImpl, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_equal, op_equal_19, op_match, op_match19, op_not, op_not_equal, op_not_match, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, rbClone, rbInspect, recacheBuiltinMethods, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted, tainted_p, testFrozen, testFrozen, to_a, to_a, to_s, trust, type, type_deprecated, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
-
Field Details
-
SLASH
-
BACKSLASH
-
URI_PREFIX_STRING
- See Also:
-
ROOT_PATTERN
-
NULL_CHAR
private static final int NULL_CHAR- See Also:
-
PROTOCOL_PATTERN
-
PROTOCOL_PREFIX_PATTERN
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
LOCK_SH
public static final int LOCK_SH- See Also:
-
LOCK_EX
public static final int LOCK_EX- See Also:
-
LOCK_NB
public static final int LOCK_NB- See Also:
-
LOCK_UN
public static final int LOCK_UN- See Also:
-
FNM_NOESCAPE
private static final int FNM_NOESCAPE- See Also:
-
FNM_PATHNAME
private static final int FNM_PATHNAME- See Also:
-
FNM_DOTMATCH
private static final int FNM_DOTMATCH- See Also:
-
FNM_CASEFOLD
private static final int FNM_CASEFOLD- See Also:
-
FNM_EXTGLOB
private static final int FNM_EXTGLOB- See Also:
-
FNM_SYSCASE
private static final int FNM_SYSCASE -
SLASHES
-
URI_PREFIX
-
path
Deprecated.
-
-
Constructor Details
-
RubyFile
-
RubyFile
-
RubyFile
-
RubyFile
-
-
Method Details
-
createFileClass
-
getNullDevice
-
rbIoClose
-
flock
-
initialize
-
chmod
-
chown
-
atime
-
ctime
-
birthtime
-
getBirthtimeWithNIO
-
lstat
-
mtime
-
path
-
path
-
truncate
-
inspect
Description copied from class:RubyBasicObjectrb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj. If not overridden, uses theto_smethod to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyIO- Returns:
- String
-
inspect
-
basename
-
basename
public static RubyString basename(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject ext) -
basename
@Deprecated public static IRubyObject basename(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated. -
basenameImpl
private static RubyString basenameImpl(ThreadContext context, RubyClass klass, IRubyObject path, IRubyObject ext) -
getSeparatorChar
-
getAltSeparatorChar
-
chmod
-
chown
-
dirname
-
dirname
-
extname
Returns the extension name of the file. An empty string is returned if the filename (not the entire path) starts or ends with a dot.- Parameters:
recv-arg- Path to get extension name of- Returns:
- Extension, including the dot, or an empty string
-
expand_path
Converts a pathname to an absolute pathname. Relative paths are referenced from the current working directory of the process unless a second argument is given, in which case it will be used as the starting point. If the second argument is also relative, it will first be converted to an absolute pathname.- Parameters:
recv-args-- Returns:
- Resulting absolute path as a String
-
expand_path19
@Deprecated public static IRubyObject expand_path19(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated. -
absolute_path
public static IRubyObject absolute_path(ThreadContext context, IRubyObject recv, IRubyObject[] args) ---------------------------------------------------- File::absolute_path File.absolute_path(file_name [, dir_string] ) -> abs_file_name From Ruby 1.9.1 ------------------------------------------------------------------------ Converts a pathname to an absolute pathname. Relative paths are referenced from the current working directory of the process unless _dir_string_ is given, in which case it will be used as the starting point. If the given pathname starts with a ``+~+'' it is NOT expanded, it is treated as a normal directory name. File.absolute_path("~oracle/bin") #=> "/~oracle/bin" - Parameters:
context-recv-args-- Returns:
-
realdirpath
-
realpath
-
realpath
-
realpath
public static IRubyObject realpath(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject cwd) -
fnmatch
Returns true if path matches against pattern The pattern is not a regular expression; instead it follows rules similar to shell filename globbing. It may contain the following metacharacters: *: Glob - match any sequence chars (re: .*). If like begins with '.' then it doesn't. ?: Matches a single char (re: .). [set]: Matches a single char in a set (re: [...]). -
dir_fnmatch
-
ftype
-
join
-
lstat
-
stat
-
atime
-
ctime
-
birthtime
-
lchmod
-
lchown
-
link
public static IRubyObject link(ThreadContext context, IRubyObject recv, IRubyObject from, IRubyObject to) -
mtime
-
rename
public static IRubyObject rename(ThreadContext context, IRubyObject recv, IRubyObject oldName, IRubyObject newName) -
split
-
symlink
public static IRubyObject symlink(ThreadContext context, IRubyObject recv, IRubyObject from, IRubyObject to) -
readlink
-
truncate
public static IRubyObject truncate(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2) -
truncate19
public static IRubyObject truncate19(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2) -
umask
-
lutime
-
utime
-
delete
-
isSymlink
-
unlink
-
unlink
-
size
-
getSize
-
mkfifo
-
mkfifo
public static IRubyObject mkfifo(ThreadContext context, IRubyObject recv, IRubyObject path, IRubyObject mode) -
mkfifo
-
getPath
-
setPath
-
getEncoding
public org.jcodings.Encoding getEncoding()- Specified by:
getEncodingin interfaceEncodingCapable
-
setEncoding
public void setEncoding(org.jcodings.Encoding encoding) - Specified by:
setEncodingin interfaceEncodingCapable
-
openFile
-
fileOpenGeneric
public IRubyObject fileOpenGeneric(ThreadContext context, IRubyObject filename, int oflags, int fmode, IOEncodable convConfig, int perm) -
getAdjustedPath
-
getAdjustedPath
public static String getAdjustedPath(ThreadContext context, IRubyObject fileOrPath, String currentDirectory) -
get_path
-
filePathConvert
-
fileResource
Get the fully-qualified JRubyFile object for the path, taking into account the runtime's current directory.- Parameters:
context- current thread contextpathOrFile- the string or IO to use for the path
-
fileResource
Get the fully-qualified JRubyFile object for the path, taking into account the runtime's current directory. Same as callingfileResource(ThreadContext, IRubyObject)- Parameters:
pathOrFile- the string or IO to use for the path
-
getDecodedPath
-
file
Deprecated. -
toString
Description copied from class:RubyObjectThe default toString method is just a wrapper that calls the Ruby "to_s" method. -
getFileEntry
private static ZipEntry getFileEntry(ZipFile jar, String path, String prefixForNoEntry) throws IOException - Throws:
IOException
-
getDirOrFileEntry
Deprecated.- Throws:
IOException
-
getDirOrFileEntry
Deprecated.- Throws:
IOException
-
isAbsolutePath
-
isWindowsDriveLetter
private static boolean isWindowsDriveLetter(char c) -
startsWithDriveLetterOnWindows
-
startsWithDriveLetterOnWindows
-
adjustRootPathOnWindows
-
extractTimespec
Extract a timespec (an array of 2 longs: seconds and nanoseconds from epoch) from an IRubyObject. -
convertTimespecToTimeval
private static long[] convertTimespecToTimeval(long[] timespec) Converts a timespec (array of 2 longs: seconds and nanoseconds from epoch) into a timeval (array of 2 longs: seconds and microseconds from epoch). This is needed because calling methods like utimensat() allows nanosecond precision, while the older utimes() only supports microsecond precision. -
checkClosed
-
expandPathInternal
private static RubyString expandPathInternal(ThreadContext context, IRubyObject[] args, boolean expandUser, boolean canonicalize) -
expandPathInternal
static RubyString expandPathInternal(ThreadContext context, RubyString path, RubyString wd, boolean expandUser, boolean canonicalize) -
expandPath
public static String expandPath(ThreadContext context, String relativePath, org.jcodings.Encoding[] enc, String cwd, boolean expandUser, boolean canonicalize) -
canonicalNormalized
-
adjustPostFixDotDot
-
concatStrings
-
canonicalizePath
-
splitURI
-
expandUserPath
This method checks a path, and if it starts with ~, then it expands the path to the absolute path of the user's home directory. If the string does not begin with ~, then the string is simply returned. unaltered.- Parameters:
context-path- Path to check- Returns:
- Expanded path
-
expandUserPath
public static String expandUserPath(ThreadContext context, String path, boolean raiseOnRelativePath) -
countSlashes
Returns a string consisting ofn-1slashes, wherenis the number of slashes at the beginning of the input string.- Parameters:
stringToCheck-- Returns:
-
canonicalize
-
canonicalize
-
isLocalURI
-
appendSlash
-
checkHome
Check if HOME environment variable is not nil nor empty- Parameters:
context-
-
toJava
Description copied from interface:IRubyObjectConvert the object to the specified Java class, if possible.- Specified by:
toJavain interfaceIRubyObject- Overrides:
toJavain classRubyIO- Parameters:
target- The target type to which the object should be converted.- See Also:
-
doJoin
-
joinImpl
private static boolean joinImpl(StringBuilder buffer, String separator, ThreadContext context, IRubyObject recv, RubyArray args) -
joinImplInspecting
private static StringBuilder joinImplInspecting(String separator, ThreadContext context, IRubyObject recv, RubyArray parent, RubyArray array) -
isDirSeparator
private static boolean isDirSeparator(char c) -
chomp
-
replace
-
truncateCommon
private static IRubyObject truncateCommon(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2) -
sites
-
initialize19
Deprecated.
-