realbasic-betas.mbox
[Top] [All Lists]

Re: [REQ] FSSpec / FSRef

To: REALbasic Betas <realbasic-betas at lists dot realsoftware dot com>
Subject: Re: [REQ] FSSpec / FSRef
From: Totte Alm <totte at code66 dot se>
Date: Tue, 14 May 2002 21:03:23 +0200

On tisdag, maj 14, 2002, at 08:47 , Kevin Ballard wrote:


There is one "problem" where FSSpecs are better then FSRefs, non-exitent
files. Many FSRef APIs fail if the file doesnt exist, so just keep that
in mind,

Then in that case FSSpec could be a nil value.


An FSSpec can point to a "non-existing file" and still be valid, allthough FSMakeFSSpec returns -43 (fnfErr), but it is still a valid FSSpec. If you try to convert that FSSpec that points to a non existing file to an FSRef and then tries to make a Path from that FSRef, the operation fails. Its a problem that FSRefs that points to non-existing files is invalid.

I know this because I wrotye a plugin to get the unix path from a FolderItem (that returns FSSpecs), and I got a hint that worked, and that was to point the FSSpec to the parent directory (which exists), and then manually add the file at the end of the path.

Btw, I will make that Plugin available when I I have documented what it does.

// Totte

----------------------------------------------------------------------------------------------
If builder built buildings, like programmers write programs,
the first passing woodpecker would destroy the entire civilization.



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