Yeah.... You are correct, moving a file into a file would not make
sense.....
moving existing files into the Temp Items folder can be tricky
business....
Can I ask why you're not creating them there in the first place using
GetTemporaryFolderItem???
Otherwise (if you are not using the system provided temporary items
folder), consider doing it this way:
Store a reference to your temp folder in a property
if not tempFolder.child(tempFile.name).exists then
tempfile.moveFileTo(tempFolder)
else
//error, already exists...
end
On 27/02/2007, at 5:40 PM, Guyren Howe wrote:
> I am attempting to move a file into the temp folder.
>
> I get a folderItem for a file inside the temp folder. This folderItem
> doesn't exist.
>
> I do foo.MoveFileTo theTempFileThatDoesntExist
>
> This gives me a foo.LastErrorCode = 105 ("Invalid name") and the file
> doesn't move.
>
> I *hypothesize* that I can only move a file to a folder, not to a
> file. I can sometimes get moving to a file to work, but I sometimes
> get the 105 (can't find a pattern).
>
> So then I try to do:
>
> foo.MoveFileTo TheTempFileThatDoesntExist.Parent
> too.Name = TheTempFileThatDoesntExist.Name
>
> And this works on the Mac but fails on Windows. Sometimes...
>
> I've wound up doing a #If TargetMacOS that does the the two-step move-
> rename on the Mac and the single-step move on Windows, and that
> appears to work.
>
> Is this all just sadly inconsistent between platforms, or am I
> missing something, or what?
>
>
> Regards,
>
> Guyren G Howe
> Relevant Logic LLC
>
> guyren-at-relevantlogic.com ~ http://relevantlogic.com
>
> REALbasic, PHP, Ruby/Rails, Python programming
> PostgreSQL, MySQL database design and consulting
> Technical writing and training
>
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>