Talk:File input/output

From Rosetta Code
Revision as of 00:55, 13 November 2007 by MikeMol (talk | contribs) (Race conditions?)

AppleScript example

Is not really a file I/O - its a file copy operation done by the file system, without even the ability to write in the file names (IIRC it executes interactive file chooser dialogs) and shouldn't be here. I don't know if AppleScript has IO commands, but if it has real IO then the example should show that and if it hasn't, then the example should be removed.

AppleScript does have real I/O, and I've written a new example that illustrates it. --Bob9000 01:05, 28 January 2007 (EST)

Perl cleanup

Removing the latest addition to the Perl section as it shows bad style. It is not representative of the current Perl version and programming practice. See reasoning in next paragraph. I'm keeping the nice while oneliner and binmode caveat, though.

Non-lexical filehandles have global scope and pollute the namespace as they cannot be restricted to the least possible lifetime. The || operator binds stricter than the or operator and forces the open function to have parentheses. The two-argument version of open is unelegant as it invites programming mistakes (see "dispelling the dweomer" in the Camel Book). 89.49.121.184 19:31, 22 January 2007 (EST)

Race conditions

A thought: Should this task be rewritten to guard against race conditions? Many of these code examples check for a file's existence, and then create the file. Between the check and the creation, another process might already have created the file. --Short Circuit 17:55, 12 November 2007 (MST)