blob: b52303071cad682df7743b6014255f256d25c4b5 (
plain) (
blame)
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
|
.help fcache Jun2011 system
.ih
NAME
fcache -- list, clean or manipulate the file cache
.ih
USAGE
fcache cmd
.ih
PARAMETERS
.ls cmd
Cache command to execute. A description of each command is given below.
.le
.ls pattern = "*"
Filename substring pattern to match when initializing the cache with
the \fIinit\fR command.
.le
.ls src = ""
Source string used to generate the cache filename. This is typically
the full path to a local file being cached or a URL.
.le
.ls fname = ""
Name of the file in the cache.
.le
.ls extn = ""
Cache filename extension.
.le
.ls age = -1
Age of the file (in days) to be purged with the \fIpurge\fR command. A value
less than zero means that the \fIcache_age\fR environment variable should
is used to set the age, a value of zero means to delete all files in the
cache (same as the \fIinit\fR command), a value greater than zero means
that files older than this age will be deleted.
.le
.ls verbose = no
Print status information as the task processes the command.
.le
.ls wait = yes
Block on operation? If 'yes' then the task will block until the requested
file becomes available in the cache.
.le
.ls cache = "cache$"
Cache directory to be used.
.le
.ih
DESCRIPTION
The \fIFCACHE\fR command is used to list or manage the system file cache
named by the \fIcache\fR parameter. If the \fIcache\fR directory does not
exist, it will be created when required. The \fIcache_age\fR environment
variable determines the default maximum age of files in the cache, older
files are automatically removed by the login.cl as part of the startup
process.
The IRAF file cache is used primarily to cache local copies of URLs in the
system to prevent repeated downloads when accessing URLs from tasks. This
allows a URL to be passed to multiple tasks without explicitly requiring
the user to create a named (temporary) file themselves.
The \fIcmd\fR parameter determines the action to take, other parameters are
used as needed depending on the command according to the following table:
.nf
Command Input Pars Output Pars Action
------- ---------- ----------- ------
init pattern Initialize the cache
purge age Purge old files
destroy Destroy the cache
list List cache contents
lookup src fname,extn Lookup a file in the cache
access src Is file in cache?
add src extn fname Add file to the cache
delete src fname Delete file from cache
wait src Wait for access to file
.fi
The \fIlookup\fR command works in two ways: If a \fIsrc\fR string is
provided then the \fIfname\fR parameter will contain the matching cached
file (and \fIextn\fR will contain the optional extension), if the \fIfanme\fR
parameter is specified then on output \fIsrc\fR will contain the original
filename/URL.
.ih
EXAMPLES
1. Remove all "url" files from the cache.
.nf
cl> fcache init pattern="url"
.fi
2. List the contents of the file cache.
.nf
cl> fcache list
.fi
3. Destroy a cache directory (i.e. remove it entirely).
.nf
cl> fcache destroy cache="/tmp/cache"
.fi
4. Purge all cache files older than 7 days:
.nf
cl> fcache purge age=7
.fi
5. Determine if a URL is already in the cache:
.nf
cl> fcache add src="/tmp/dpix.fits"
cl> fcache list
f1128531670 1 /tmp/dpix.fits
f789045894 1 http://iraf.noao.edu/vao/dpix.fits
cl> fcache access src="/tmp/dpix.fits"
yes
cl> fcache access src="http://iraf.noao.edu/vao/dpix.fits"
yes
.fi
6. Delete a cached URL:
.nf
cl> fcache delete src="http://iraf.noao.edu/vao/dpix.fits"
.fi
7. Add a local file to the cache, then look it up:
.nf
cl> fcache add src="/tmp/test.fits"
cl> fcache lookup src="/tmp/test.fits"
cl> =fcache.fname
f1295587026
cl> fcache lookup fname="f1295587026"
cl> =fcache.src
/tmp/test.fits
.fi
.ih
BUGS
.ih
SEE ALSO
head
.endhelp
|