aboutsummaryrefslogtreecommitdiff
path: root/doc/pddp/textfile-help.pd
blob: 286a53f0333dc5d288a7b349a592eb71ac76c5a6 (plain)
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
#N canvas 0 0 555 619 10;
#X obj 0 595 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0
14 -228856 -66577 0;
#X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header textfile 3 12 0
18 -204280 -1 0;
#X obj 0 429 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13
-228856 -1 0;
#N canvas 52 243 494 344 META 0;
#X text 12 125 LIBRARY internal;
#X text 12 165 WEBSITE http://crca.ucsd.edu/~msp/;
#X text 12 25 LICENSE SIBSD;
#X text 12 145 AUTHOR Miller Puckette;
#X text 12 205 HELP_PATCH_AUTHORS Updated for Pd version 0.33. Jonathan
Wilkes revised the patch to conform to the PDDP template for Pd version
0.42.;
#X text 12 45 DESCRIPTION read and write text files;
#X text 12 65 INLET_0 bang rewind clear add add2 set read write print
;
#X text 12 85 OUTLET_0 list;
#X text 12 105 OUTLET_1 bang;
#X text 12 5 KEYWORDS control storage filesystem list_op anything_op
;
#X text 12 185 RELEASE_DATE 1997;
#X restore 500 597 pd META;
#X obj 0 465 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0
13 -228856 -1 0;
#X obj 0 531 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12
0 13 -228856 -1 0;
#X obj 0 558 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12
0 13 -228856 -1 0;
#X text 98 535 (none);
#N canvas 73 482 428 109 Related_objects 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X text 8 2 [textfile] Related Objects;
#X obj 22 43 qlist;
#X restore 102 597 pd Related_objects;
#X obj 78 438 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856
-162280 0;
#X obj 78 474 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856
-162280 0;
#X obj 78 498 cnv 17 3 17 empty \$0-pddp.cnv.let.1 1 5 9 0 16 -228856
-162280 0;
#X text 11 23 read and write text files;
#X obj 435 20 pddp/pddplink http://wiki.puredata.info/en/textfile -text
pdpedia: textfile;
#X obj 465 3 textfile;
#X obj 85 347 print done;
#X text 98 497 bang;
#X text 167 497 - this outlet gets a bang when you hit the end of the
sequence.;
#X text 98 473 list;
#X text 168 473 - this outlet gets the lines in sequence.;
#X text 168 437 (see the example above for messages accepted by [textfile])
;
#X msg 101 76 rewind;
#X text 214 207 read a file;
#X msg 101 208 read textfile.txt;
#X text 152 75 go to beginning;
#X msg 101 98 bang;
#X text 152 97 output one line as a list;
#X msg 101 230 write /tmp/textfile.txt;
#X msg 101 252 write /tmp/textfile2.txt cr;
#X msg 101 274 read textfile.txt cr;
#X msg 101 120 clear;
#X text 152 119 empty the object;
#X text 208 142 add a message;
#X msg 101 186 set 2 4 6 8;
#X text 208 186 clear and then add one message;
#X msg 101 142 add cis boom bah;
#X msg 101 164 add2 bang;
#X text 208 164 add an unterminated message;
#X msg 101 296 print;
#X text 145 296 debugging printout;
#X text 248 229 write a file;
#X obj 40 322 textfile;
#X text 272 251 write a file \, terminating lines with a;
#X text 273 266 carriage return (omitting semicolons).;
#X text 272 281 You can read files this way \, too \, in;
#X text 273 296 which case carriage returns are mapped;
#N canvas 94 361 428 199 About_textfile 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X text 8 2 [textfile] Related Objects;
#X text 21 38 The textfile object reads and writes text files to and
from memory. You can read a file and output sequential lines as messages
\, or collect lines and write them out. You can use this object to
generate "models" for Gem \, for instance.;
#X text 20 91 To record textual messages and save them to a file \,
first send "clear" to empty the sequence and "add" to add messages
(terminated with semicolons.) The message \, "add2" adds a list of
atoms without finishing with a semicolon in case you want to make variable-length
messages.;
#X text 20 155 You can also use this object simply for storing heterogeneous
sequences of messages.;
#X restore 101 567 pd About_textfile;
#X obj 40 369 print message;
#X obj 4 597 pddp/pddplink all_about_help_patches.pd -text Usage Guide
;
#X text 274 311 to semicolons.;
#X connect 21 0 41 0;
#X connect 23 0 41 0;
#X connect 25 0 41 0;
#X connect 27 0 41 0;
#X connect 28 0 41 0;
#X connect 29 0 41 0;
#X connect 30 0 41 0;
#X connect 33 0 41 0;
#X connect 35 0 41 0;
#X connect 36 0 41 0;
#X connect 38 0 41 0;
#X connect 41 0 47 0;
#X connect 41 1 15 0;