[Swift-user] Using the writeData() built-in function
wilde at mcs.anl.gov
wilde at mcs.anl.gov
Thu Jan 28 21:26:58 CST 2010
Below is some preliminary info (a tiny example) on writing files from Swift using the not-yet-well-documented function writeData().
http://www.ci.uchicago.edu/swift/guides/userguide.php#procedure.writedata
Other than this function, the only way to write data to a file is to call an app() that writes the data.
Note that writeData was meant solely to assist in writing long argument lists to a file that can be passed to an app() function, to avoid passing overly-long command lines.
Ive been exploring a few simple "library" functions writing using simple apps like echo and awk to do data formatting or conversion. While thats not ready for release, I just want to hint to those who need it that such techniques are reasonable and feasible.
In general, common practice in Swift is *not* to write general data files directly via Swift statements, but rather to call app() functions that write data files.
- Mike
----- Forwarded Message -----
From: "Ben Clifford" <benc at hawaga.org.uk>
To: swift-devel at ci.uchicago.edu
Sent: Wednesday, July 1, 2009 10:37:28 AM GMT -06:00 US/Canada Central
Subject: [Swift-devel] writeData
r2994 contains a writeData function which does the opposite of readData.
Specifically, you can say:
file l;
l = writeData(@f);
to output the filenames for a data structure into a text file, so that you
can pass this instead of passing filenames on the command line.
--
_______________________________________________
Swift-devel mailing list
Swift-devel at ci.uchicago.edu
http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
More information about the Swift-user
mailing list