I am at least somewhat confused about how GetFolderItem and FolderItem work. I want to open and read a text file located in the user/library/preferences folder or the equivalent on a Windows machine.
dim f as folderitem
dim sPath as string
dim tTextIn as TextInputputStream
f = SpecialFolder.Preferences
sPath = f.NativePath + "/MyPreferences.txt"
f = GetFolderItem(sPath,1)
if f.Exists then
tTextIn = TextInputStream.Open(f)
...
Is this basically the correct sequence? I know I don’t have the error checking in there but is this the right approch?
[quote=46626:@william plunkett]I am at least somewhat confused about how GetFolderItem and FolderItem work. I want to open and read a text file located in the user/library/preferences folder or the equivalent on a Windows machine.
dim f as folderitem
dim sPath as string
dim tTextIn as TextInputputStream
f = SpecialFolder.Preferences
sPath = f.NativePath + "/MyPreferences.txt"
f = GetFolderItem(sPath,1)
if f.Exists then
tTextIn = TextInputStream.Open(f)
...
Is this basically the correct sequence? [/quote]
Umm no
No need to get the path turn it into text then use getfolderitem
f = SpecialFolder.Preferences.Child("MyPreferences.txt")
if f <> nil and f.Exists then
tTextIn = TextInputStream.Open(f)
end if