File: ref_c_file__stat.xml

package info (click to toggle)
rubybook 0.2.1-1
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k, lenny, squeeze, wheezy
  • size: 4,248 kB
  • ctags: 1,042
  • sloc: xml: 60,486; makefile: 25
file content (964 lines) | stat: -rw-r--r-- 24,374 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
<ppdoc>
<copyright>
    Copyright (c) 2001 by Addison Wesley Longman.  This
    material may be distributed only subject to the terms and
    conditions set forth in the Open Publication License, v1.0 or
    later (the latest version is presently available at
    http://www.opencontent.org/openpub/).
</copyright>
<class name="File::Stat" super="Object" type="class">  
<p/>
  Objects of class <classname>File::Stat</classname> encapsulate common status information for
  <classname>File</classname> objects.  The information is recorded at the
  moment the <classname>File::Stat</classname> object is created; changes made to the file
  after that point will not be reflected.
  <classname>File::Stat</classname> objects are returned by <cim><file>io</file><front>IO</front><back>stat</back><mref>stat</mref></cim>, 
  <ccm><file>file</file><front>File</front><back>stat</back><mref>stat</mref></ccm>, <cim><file>file</file><front>File</front><back>lstat</back><mref>lstat</mref></cim>, and <ccm><file>file</file><front>File</front><back>lstat</back><mref>lstat</mref></ccm>.
  Many of these methods return platform-specific
  values, and not all values are meaningful on all systems.
  See also <mim><file>kernel</file><front>Kernel</front><back>test</back><mref>test</mref></mim> on page 429.
  <mixins>
    <mixin name="Comparable">
   &lt;, &lt;=, ==, &gt;=, &gt;, between?</mixin>
  </mixins>
<p/>
  <methods type="instance">
<p/>
        <method name="&lt;=&gt;" ref="_lt_eq_lt">
      <callseq>
        <obj>statfile</obj> &lt;=&gt; <obj>anOtherStat</obj>
        <returns>-1, 0, 1</returns>
      </callseq>
      <desc>
<p/>
       Compares <classname>File::Stat</classname> objects by comparing their respective
       modification times.
<p/>
<codefragment>
<fullcode><![CDATA[        f1 = File.new("f1", "w")
        sleep 1 #!sh!
        f2 = File.new("f2", "w")
        f1.stat <=> f2.stat
]]></fullcode><rubycode>
<tr>
<td colspan="3"><tt>f1<nbsp/>=<nbsp/>File.new("f1",<nbsp/>"w")</tt></td>
</tr>
<tr>
<td colspan="3"><tt>sleep<nbsp/>1</tt></td>
</tr>
<tr>
<td colspan="3"><tt>f2<nbsp/>=<nbsp/>File.new("f2",<nbsp/>"w")</tt></td>
</tr>
<tr>
  <td><tt>f1.stat<nbsp/>&lt;=&gt;<nbsp/>f2.stat</tt></td>
  <td>&#187;</td>
  <td><tt>-1</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="atime" ref="atime">
      <callseq>
        <obj>statfile</obj>.atime
        <returns><obj>aTime</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns the last access time for this file 
      as an object of class <classname>Time</classname>.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").atime
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").atime</tt></td>
  <td>&#187;</td>
  <td><tt>Wed<nbsp/>Dec<nbsp/>31<nbsp/>18:00:00<nbsp/>CST<nbsp/>1969</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="blksize" ref="blksize">
      <callseq>
        <obj>statfile</obj>.blksize
        <returns><obj>anInteger</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns the native file system's block size.
      Will return 0 on platforms that don't support this information.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").blksize
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").blksize</tt></td>
  <td>&#187;</td>
  <td><tt>4096</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="blockdev?" ref="blockdev_qm">
      <callseq>
        <obj>statfile</obj>.blockdev?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if the file is a block device, <const>false</const>
      if it isn't or 
      if the operating system doesn't support this feature.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").blockdev?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").blockdev?</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="blocks" ref="blocks">
      <callseq>
        <obj>statfile</obj>.blocks
        <returns><obj>anInteger</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns the number of native file system blocks allocated for
      this file, or 0
      if the operating system doesn't support this feature.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").blocks
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").blocks</tt></td>
  <td>&#187;</td>
  <td><tt>2</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="chardev?" ref="chardev_qm">
      <callseq>
        <obj>statfile</obj>.chardev?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if the file is a character device, <const>false</const>
      if it isn't or 
      if the operating system doesn't support this feature.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("/dev/tty").chardev?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("/dev/tty").chardev?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="ctime" ref="ctime">
      <callseq>
        <obj>statfile</obj>.ctime
        <returns><obj>aTime</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns the change time for <obj>statfile</obj> (that is, the time
      directory information about the file was changed, not the file
      itself).
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").ctime
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").ctime</tt></td>
  <td>&#187;</td>
  <td><tt>Sun<nbsp/>Mar<nbsp/>04<nbsp/>23:28:25<nbsp/>CST<nbsp/>2001</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="dev" ref="dev">
      <callseq>
        <obj>statfile</obj>.dev
        <returns><obj>aFixnum</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns an integer representing the device on which <obj>statfile</obj>
      resides.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").dev
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").dev</tt></td>
  <td>&#187;</td>
  <td><tt>774</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="directory?" ref="directory_qm">
      <callseq>
        <obj>statfile</obj>.directory?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> is a directory, <const>false</const> 
      otherwise.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").directory?
        File.stat(".").directory?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").directory?</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
<tr>
  <td><tt>File.stat(".").directory?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="executable?" ref="executable_qm">
      <callseq>
        <obj>statfile</obj>.executable?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> is executable or if the
      operating system doesn't distinguish executable files from
      nonexecutable files.  The tests are made using the effective
      owner of the process.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").executable?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").executable?</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="executable_real?" ref="executable_real_qm">
      <callseq>
        <obj>statfile</obj>.executable_real?
    <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Same as <tt>executable?</tt>, but tests using the real owner of the
      process.
<p/>
      </desc>
    </method>
<p/>
        <method name="file?" ref="file_qm">
      <callseq>
        <obj>statfile</obj>.file?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
     Returns <const>true</const> if <obj>statfile</obj> is a regular file (not a device 
     file, pipe, socket, etc.).
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").file?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").file?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="ftype" ref="ftype">
      <callseq>
        <obj>statfile</obj>.ftype
        <returns><obj>fileType</obj></returns>
      </callseq>
      <desc>
<p/>
      Identifies the type of <obj>statfile</obj>.
      The return string is one of: 
        ``<tt>file</tt>'',
        ``<tt>directory</tt>'',
        ``<tt>characterSpecial</tt>'',
        ``<tt>blockSpecial</tt>'',
        ``<tt>fifo</tt>'',
        ``<tt>link</tt>'', or
        ``<tt>socket</tt>''.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("/dev/tty").ftype
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("/dev/tty").ftype</tt></td>
  <td>&#187;</td>
  <td><tt>"characterSpecial"</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="gid" ref="gid">
      <callseq>
        <obj>statfile</obj>.gid
        <returns><obj>aFixnum</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns the numeric group id of the owner of <obj>statfile</obj>.      
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").gid
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").gid</tt></td>
  <td>&#187;</td>
  <td><tt>500</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="grpowned?" ref="grpowned_qm">
      <callseq>
        <obj>statfile</obj>.grpowned?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns true if the effective group id of the process is the same 
      as the group id of <obj>statfile</obj>.
      On Windows NT, returns <const>false</const>.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").grpowned?
        File.stat("/etc/passwd").grpowned?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").grpowned?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
<tr>
  <td><tt>File.stat("/etc/passwd").grpowned?</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="ino" ref="ino">
      <callseq>
        <obj>statfile</obj>.ino
        <returns><obj>aFixnum</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns the inode number for <obj>statfile</obj>.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").ino
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").ino</tt></td>
  <td>&#187;</td>
  <td><tt>43331</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="mode" ref="mode">
      <callseq>
        <obj>statfile</obj>.mode
        <returns><obj>aFixnum</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns an integer representing the permission bits of
      <obj>statfile</obj>.  The meaning of the bits is platform dependent; on Unix
      systems, see <tt>stat(2)</tt>.
<p/>
<codefragment>
<fullcode><![CDATA[        File.chmod(0644, "testfile")
        s = File.stat("testfile")
        sprintf("%o", s.mode)
]]></fullcode><rubycode>
<tr>
  <td><tt>File.chmod(0644,<nbsp/>"testfile")</tt></td>
  <td>&#187;</td>
  <td><tt>1</tt></td>
</tr>
<tr>
<td colspan="3"><tt>s<nbsp/>=<nbsp/>File.stat("testfile")</tt></td>
</tr>
<tr>
  <td><tt>sprintf("%o",<nbsp/>s.mode)</tt></td>
  <td>&#187;</td>
  <td><tt>"100644"</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="mtime" ref="mtime">
      <callseq>
        <obj>statfile</obj>.mtime
        <returns><obj>aTime</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns the modification time for <obj>statfile</obj>.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").mtime
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").mtime</tt></td>
  <td>&#187;</td>
  <td><tt>Sun<nbsp/>Mar<nbsp/>04<nbsp/>23:28:25<nbsp/>CST<nbsp/>2001</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="nlink" ref="nlink">
      <callseq>
        <obj>statfile</obj>.nlink
        <returns><obj>aFixnum</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns the number of hard links to <obj>statfile</obj>.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").nlink
        File.link("testfile", "testfile.bak")
        File.stat("testfile").nlink
!-          File.delete("testfile.bak")
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").nlink</tt></td>
  <td>&#187;</td>
  <td><tt>1</tt></td>
</tr>
<tr>
  <td><tt>File.link("testfile",<nbsp/>"testfile.bak")</tt></td>
  <td>&#187;</td>
  <td><tt>0</tt></td>
</tr>
<tr>
  <td><tt>File.stat("testfile").nlink</tt></td>
  <td>&#187;</td>
  <td><tt>2</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="owned?" ref="owned_qm">
      <callseq>
        <obj>statfile</obj>.owned?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if the effective user id of the process is the same 
      as the owner of <obj>statfile</obj>.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").owned?
        File.stat("/etc/passwd").owned?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").owned?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
<tr>
  <td><tt>File.stat("/etc/passwd").owned?</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="pipe?" ref="pipe_qm">
      <callseq>
        <obj>statfile</obj>.pipe?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if the operating system supports pipes and
      <obj>statfile</obj> is a pipe; <const>false</const> otherwise.
<p/>
      </desc>
    </method>
<p/>
        <method name="rdev" ref="rdev">
      <callseq>
        <obj>statfile</obj>.rdev
        <returns><obj>aFixnum</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns an integer representing the device type on which <obj>statfile</obj>
      resides.  Returns <tt>0</tt> 
      if the operating system doesn't support this feature.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("/dev/fd0").rdev
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("/dev/fd0").rdev</tt></td>
  <td>&#187;</td>
  <td><tt>512</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="readable?" ref="readable_qm">
      <callseq>
        <obj>statfile</obj>.readable?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> is readable by the effective
      user id of this process.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").readable?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").readable?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="readable_real?" ref="readable_real_qm">
      <callseq>
        <obj>statfile</obj>.readable_real?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> is readable by the real
      user id of this process.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").readable_real?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").readable_real?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="setgid?" ref="setgid_qm">
      <callseq>
        <obj>statfile</obj>.setgid?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> has the set-group-id      
      permission bit set, <const>false</const> if it doesn't or
      if the operating system doesn't support this feature.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("/usr/sbin/lpc").setgid?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("/usr/sbin/lpc").setgid?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="setuid?" ref="setuid_qm">
      <callseq>
        <obj>statfile</obj>.setuid?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> has the set-user-id
      permission bit set, <const>false</const> if it doesn't or
      if the operating system doesn't support this feature.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("/bin/su").setuid?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("/bin/su").setuid?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="size" ref="size">
      <callseq>
        <obj>statfile</obj>.size
        <returns><obj>aFixnum</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns the size of <obj>statfile</obj> in bytes.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").size
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").size</tt></td>
  <td>&#187;</td>
  <td><tt>66</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="size?" ref="size_qm">
      <callseq>
        <obj>statfile</obj>.size?
        <returns><obj>aFixnum</obj> or <tt>nil</tt></returns>
      </callseq>
      <desc>
<p/>
      Returns <tt>nil</tt> if <obj>statfile</obj> is a zero-length file; otherwise,
      returns the file size.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").size?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").size?</tt></td>
  <td>&#187;</td>
  <td><tt>66</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="socket?" ref="socket_qm">
      <callseq>
        <obj>statfile</obj>.socket?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> is a socket, <const>false</const> if
      it isn't or 
      if the operating system doesn't support this feature.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").socket?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").socket?</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="sticky?" ref="sticky_qm">
      <callseq>
        <obj>statfile</obj>.sticky?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> has its sticky bit set,
      <const>false</const> if it doesn't or if the operating system doesn't
      support this feature.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").sticky?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").sticky?</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="symlink?" ref="symlink_qm">
      <callseq>
        <obj>statfile</obj>.symlink?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> is a symbolic link,
      <const>false</const> if it isn't or if the operating system doesn't
      support this feature. As <ccm><file>file</file><front>File</front><back>stat</back><mref>stat</mref></ccm> automatically follows
      symbolic links, <meth>symlink?</meth> will always be
      <const>false</const> for an object returned by <ccm><file>file</file><front>File</front><back>stat</back><mref>stat</mref></ccm>.
<p/>
<codefragment>
<fullcode><![CDATA[        File.symlink("testfile", "alink")
        File.stat("alink").symlink?
        File.lstat("alink").symlink?
!-      File.delete("alink")
]]></fullcode><rubycode>
<tr>
  <td><tt>File.symlink("testfile",<nbsp/>"alink")</tt></td>
  <td>&#187;</td>
  <td><tt>0</tt></td>
</tr>
<tr>
  <td><tt>File.stat("alink").symlink?</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
<tr>
  <td><tt>File.lstat("alink").symlink?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="uid" ref="uid">
      <callseq>
        <obj>statfile</obj>.uid
        <returns><obj>aFixnum</obj></returns>
      </callseq>
      <desc>
<p/>
      Returns the numeric user id of the owner of <obj>statfile</obj>.      
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").uid
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").uid</tt></td>
  <td>&#187;</td>
  <td><tt>501</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="writable?" ref="writable_qm">
      <callseq>
        <obj>statfile</obj>.writable?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> is writable by the effective
      user id of this process.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").writable?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").writable?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="writable_real?" ref="writable_real_qm">
      <callseq>
        <obj>statfile</obj>.writable_real?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> is writable by the real
      user id of this process.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").writable_real?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").writable_real?</tt></td>
  <td>&#187;</td>
  <td><tt>true</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
        <method name="zero?" ref="zero_qm">
      <callseq>
        <obj>statfile</obj>.zero?
        <returns><const>true</const> or <const>false</const></returns>
      </callseq>
      <desc>
<p/>
      Returns <const>true</const> if <obj>statfile</obj> is a zero-length file; <const>false</const>
      otherwise.
<p/>
<codefragment>
<fullcode><![CDATA[        File.stat("testfile").zero?
]]></fullcode><rubycode>
<tr>
  <td><tt>File.stat("testfile").zero?</tt></td>
  <td>&#187;</td>
  <td><tt>false</tt></td>
</tr>
</rubycode>
<p/>
</codefragment>
<p/>
      </desc>
    </method>
<p/>
  </methods>
<p/>
</class>
</ppdoc>