realbasic-nug
[Top] [All Lists]

Re: FolderItem.CreateAsFolder creates a file

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: FolderItem.CreateAsFolder creates a file
From: Dennis Birch <dennisbirch@gmail.com>
Date: Sat, 27 Feb 2010 12:50:13 -0800
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; dkim=neutral (body hash did not verify) header.i=@gmail.com
Delivered-to: listarchive@realsoftware.com
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=CpZoAuO5FkECsvKKgKZWvRShB1eljBoS+6v6h7sHVN4=; b=gLW9omL39WrEXM3+ZuCugyXN1CFg1LPwx+oMUVn4dGyvqxQetB5yTo8D4alc0qr04v g50MuR78Ry9uh54bh0x1ONooagNNMqduEj+tchMDOCPsc4/MSlFjgaSJD6r3skJ596hv X/syQdhPQ0pHoxIeiVwTlO9tSqr5qZ/ZuV0Kg=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=eEE8g5ZpLBrSOmulVd0fLBG4/cTzP1TheQw2K8yyUlQUKGwSUmy0moHoCEg/7Wo8fI NAKyJ0kITYs1nE9wgvDNOAjfTIxDf/UQjJx5kbCiCZLu6/XpGp85kV06G20hcq8zRgrv ETE1SrWniVF12fOy0vHdvtgXKmVGo3M0kINsU=
In-reply-to: <C68D7161-EE0E-46CA-801D-CDFF5833B119@frontiernet.net>
References: <fed2e2561002271218t6d5bbb35ga04e775ef86ae138@mail.gmail.com> <C68D7161-EE0E-46CA-801D-CDFF5833B119@frontiernet.net>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
On Sat, Feb 27, 2010 at 12:41 PM, Harrie Westphal
<harriew@frontiernet.net> wrote:
>
> With the lack of information, no code example given, it is pretty tough to 
> try and guess at what your problem may be. How is the folderitem set? Have 
> you done all the appropriate testing for non-existence etc. before attempting 
> to create the folder? Have you tested error codes along the way? All that 
> good stuff. Is the length of this file zero bytes? If your code is truly 
> creating a file instead of a folder I would think its length would be zero 
> bytes since nothing was written to it. If it is not zero bytes then I would 
> think that a file existed that just happened to have the name of the folder 
> and you have not performed the proper tests to see this. But this is all pure 
> guessing at this point.

Good point about no code or other information...

  dim f As FolderItem = GetSupportFolder
  if f = nil Then Return nil

  f = f.Child("Library Files")
  if f = nil Then Return nil

  dim makeNewDestFolder As Boolean

  if not f.Exists Then
    f.CreateAsFolder
    makeNewDestFolder = True
  end if

In this case the FolderItem that GetSupportFolder returns is a newly
created folder. I expected that the file created where the folder was
supposed to be would be 0 bytes, but it turns out to be 45 bytes in
length, and contains what could be the partial contents of a file it's
supposed to contain. That could be due to a routine that runs at
application close trying to write the file that's supposed to be
within the folder. I haven't been able to reproduce the problem on my
own Macs in order to determine that one way or another.

_______________________________________________
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>