outfile
outfile(S_fileName[t_mode] [g_openHiddenFile] ) =>p_outport/nil
Description
Opens an output port ready to write to a file.
The file can be specified with either an absolute path or a relative path. If a relative path is given and the current SKILL path setting is not nil, all directory paths from SKILL path are checked in order, for that file. A path that is anchored to the current directory, for example, ./, ../, or ../../.., and so on, is not considered as a relative path. If found, the system overwrites the first updatable file in the list. If no updatable file is found, it places a new file of that name in the first writable directory.
If the optional g_openHiddenFile argument (which is intended to be used on Windows only) is specified, the system will be forced to open a Windows hidden file. The g_openHiddenFile must be used for openning existing Windows hidden files only. If the named Windows hidden file does not exist (including the current SKILL path), outfile will fail. In addition, the t_mode option must also be specified (to either w or a only) if g_openHiddenFile is given.
Arguments
Value Returned
|
If the named file cannot be opened for writing or the named Windows hidden file does not exist (including the current SKILL path). |
|
Examples
p = outfile("/tmp/out.il" "w")
=> port:"/tmp/out.il"
outfile("/bin/ls")
=> nil
To force opening a Windows hidden file t_mode must also be specified.
outfile( "aHiddenFile" "w" t)
Related Topics
Return to top