realbasic-nug
[Top] [All Lists]

Re: Setting a file's type

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Setting a file's type
From: Norman Palardy <npalardy@great-white-software.com>
Date: Thu, 30 Sep 2010 17:23:12 -0600
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <81C3DF61-4A5D-4F53-BDC9-E2BB4F057F50@shaw.ca>
References: <C8F6285A9396A74B96F9C1CE1F07A0E8D382F83012@SRV-DC-01> <9484B402-F350-4DAD-96F0-0022B1CFA603@great-white-software.com> <81C3DF61-4A5D-4F53-BDC9-E2BB4F057F50@shaw.ca>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Sep 30, 2010, at 5:01 PM, Terry Ford wrote:


On Sep 30, 2010, at 1:31 PM, Norman Palardy wrote:


On Sep 30, 2010, at 2:02 PM, Greg O'Lone wrote:

I know that I can set a file's type in the GetOpenFolderItem and GetSaveFolderItem methods, but for the life of me, I can't figure out how to set the type of a file without showing the user a dialog.

My code looks like this:
Dim ds as string = "filename.sql"
Dim outputfile as folderitem = SpecialFolder.Desktop.child(ds)
dim OutputStream as TextOutputStream = TextOutputStream.Create(outputfile)
OutputStream.WriteLine("--START--")
OutputStream.Close

set the properties of the outputfile AFTER writing all your data

OutputStreams are a strange beast themselves. I have found that creating filetypes solves many problems but they can be created by default without them. This is not documented very well.

Not at all

I gather you are suggesting to create the text file first and then change its type properties. If that's the case, why isn't it documented?

you mean like <http://docs.realsoftware.com/index.php/FolderItem.Type>
or <http://docs.realsoftware.com/index.php/FolderItem.MacType> ?

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>