FileIo

From Director Online Wiki
Jump to: navigation, search

Docs

http://www.developerdispatch.com/articles/lingolounge/ll025.html http://livedocs.macromedia.com/director/mx2004/release_update_en/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Director_MX_2004_Documentation&file=07_me344.htm http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_3177

Bugs

getOsDirectory()

there's an old cross-platform discrepancy in FileIO's GetOsDirectory() command : on the Mac, it will return the path with a folder separator at the end, like this:

"Macintosh HD:System:"

whereas on Windows it doesn't, like this:

"c:\WINDOWS"

bear this in mind if you have to use that command on a cross-platform project, as you'll have to add a "\" at the end of the path on windows.

fileWrite()

on windows writing a RETURN char works fine since xtra version 10(?) and is converted to a CRLF (chartonum(13)&chartonum(10)) - as long as the file has '.txt' as its extension. this fails, however, with different custom extensions, just like it did before with all file types. workaround could be replaceing all RETURN chars be RETURN & chartonum(10). (it does not help to let fileio save the file as .txt and then have it renamed since its newly written then)