File Tests method list : File tests « File Directory « Ruby

Home
Ruby
1.ActiveRecord
2.Array
3.CGI
4.Class
5.Collections
6.Database
7.Date
8.Design Patterns
9.Development
10.File Directory
11.GUI
12.Hash
13.Language Basics
14.Method
15.Network
16.Number
17.Rails
18.Range
19.Reflection
20.Statement
21.String
22.Threads
23.Time
24.Tk
25.Unit Test
26.Windows Platform
27.XML
Ruby » File Directory » File tests 




File Tests method list


Test    Returns     Meaning
?A      Time        Last access time for file1
?b      Boolean     True if file1 is a block device
?c      Boolean     True if file1 is a character device
?C      Time        Last change time for file1
?d      Boolean     True if file1 exists and is a directory
?e      Boolean     True if file1 exists
?f      Boolean     True if file1 exists and is a regular file
?g      Boolean     True if file1 has the \CF{setgidbit set (false under NT)
?G      Boolean     True if file1 exists and has a group ownership equal to the caller's group
?k      Boolean     True if file1 exists and has the sticky bit set
?l      Boolean     True if file1 exists and is a symbolic link
?M      Time        Last modification time for file1
?o      Boolean     True if file1 exists and is owned by the caller's effective uid
?O      Boolean     True if file1 exists and is owned by the caller's real uid
?p      Boolean     True if file1 exists and is a FIFO
?r      Boolean     True if file1 is readable by the effective uid/gid of the caller
?R      Boolean     True if file1 is readable by the real uid/gid of the caller
?s      Int/nil     If file1 has nonzero size, return the size; otherwise return nil
?S      Boolean     True if file1 exists and is a socket
?u      Boolean     True if file1 has the setuid bit set
?w      Boolean     True if file1 exists and is writable by the effective uid/gid
?W      Boolean     True if file1 exists and is writable by the real uid/gid
?x      Boolean     True if file1 exists and is executable by the effective uid/gid
?X      Boolean     True if file1 exists and is executable by the real uid/gid
?z      Boolean     True if file1 exists and has a zero length

 














Related examples in the same category
1.File tests for two files
2.Testing single files
3.# Comparing two files f and g
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.