1PFT::Content::File(3) User Contributed Perl DocumentationPFT::Content::File(3)
2
3
4
6 PFT::Content::File - On disk content file.
7
9 use PFT::Content::File;
10
11 my $f1 = PFT::Content::File->new({
12 tree => $tree,
13 path => $path,
14 name => $name, # optional, defaults to basename($path)
15 });
16
18 This class describes a content file on disk.
19
20 Properties
21 Besides the properties following in this section, more are inherited
22 from "PFT::Content::Base".
23
24 path
25 Absolute path of the file on the filesystem.
26
27 encpath
28 Absolute path, encoded with locale
29
30 filename
31 Base name of the file
32
33 mtime
34 Last modification time according to the filesystem.
35
36 open
37 Open a file descriptor for the file:
38
39 $f->open # Read file descriptor
40 $f->open($mode) # Open with r|w|a mode
41
42 This method does automatic error checking (confessing on error).
43
44 touch
45 Change modification time on the filesytem to current timestamp.
46
47 exists
48 Verify if the file exists
49
50 empty
51 Check if the file is empty
52
53 unlink
54 rename_as
55 Move the file in the filesystem, update internal data.
56
57
58
59perl v5.36.0 2022-07-22 PFT::Content::File(3)