Xojo Conferences
MBSOct2019CologneDE

Alternative to FSpExchangeFiles? (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: IDE crashes while compiling
Next thread: Getting all the items in a folder


Re: MIDI Files   -   "Elvin S. Rodríguez" <
  Alternative to FSpExchangeFiles?   -   Joerg Pressel
   Re: Alternative to FSpExchangeFiles?   -   Thomas Reed
    Re: Alternative to FSpExchangeFiles?   -   Patrick Wynne
     Re: Alternative to FSpExchangeFiles?   -   Thomas Reed
     Re: Alternative to FSpExchangeFiles?   -   Jörg Pressel <
      Re: Alternative to FSpExchangeFiles?   -   Patrick Wynne
    Re: Alternative to FSpExchangeFiles?   -   Norman Palardy
   RBscript help (RB 4.02)   -   David E. Garrett

Alternative to FSpExchangeFiles?
Date: 08.05.02 08:15 (Wed, 08 May 2002 09:15:13 +0200)
From: Joerg Pressel
Slightly off, because toolbox related:

I'm using the file exchange call "FSpExchangeFiles" with great success, but
unfortunately this does not work with certain volumes (e.g. Fat32) - error
-50 is returned ("Function not supported by volume").

Any thoughts for a solution?

TIA,

Jörg

____________________________________________
three-2-one interaktive Medien GmbH

<email address removed>
http://www.three-2-one.com
fon: +49 2151 319450

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Alternative to FSpExchangeFiles?
Date: 08.05.02 16:35 (Wed, 8 May 2002 10:35:59 -0500)
From: Thomas Reed
>I'm using the file exchange call "FSpExchangeFiles" with great success, but
>unfortunately this does not work with certain volumes (e.g. Fat32) - error
>-50 is returned ("Function not supported by volume").

I have no experience with this, but you could try the slightly more
complicated PBExchangeFiles routine. It may or may not work.

However, is there really a reason to use this? It does the exchange by
actually moving the data from each file to the other. This seems awfully
complicated when, for almost all purposes I can think of, simply swapping
the two files' positions (and possibly things like names, creators,
types, etc) would work just as well, and be less prone to errors.

-Thomas

Personal web page: http://home.earthlink.net/~thomasareed/
My shareware: http://home.earthlink.net/~thomasareed/shareware/
REALbasic page: http://home.earthlink.net/~thomasareed/realbasic/
Pixel Pen web pub. guide: http://home.earthlink.net/~thomasareed/pixelpen/

Why are there Interstate highways in Hawaii?

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Alternative to FSpExchangeFiles?
Date: 08.05.02 18:41 (Wed, 8 May 2002 10:41:39 -0700 (PDT))
From: Patrick Wynne
--- Thomas Reed <<email address removed>> wrote:
> >I'm using the file exchange call "FSpExchangeFiles" with great
> >success, but unfortunately this does not work with certain volumes
> >(e.g. Fat32) - error -50 is returned ("Function not supported by
> >volume").
>
> I have no experience with this, but you could try the slightly more
> complicated PBExchangeFiles routine. It may or may not work.
>
> However, is there really a reason to use this? It does the exchange
> by actually moving the data from each file to the other. This seems
> awfully complicated when, for almost all purposes I can think of,
> simply swapping the two files' positions (and possibly things like
> names, creators, types, etc) would work just as well, and be less
> prone to errors.

Actually, that's exactly what FSpExchangeFiles does. It exchanges info
from the catalog entry and (if the file is open) file control block,
specifically: data/resource fork lengths (both logical and physical),
starting allocation block, modification date, file ID, directory ID,
and name.

That's why it can't exchange files on two different volumes; if it
exchanged the actual data I don't think that would be a problem.

I don't know why FSpExchangeFiles didn't work. Perhaps PBExchangeFiles
would or perhaps the Fat32 filesystem doesn't support exchange
capability? There is a note about such a thing in the docs on this
function.

Patrick

=#DyPatrick Wynne
<http://home.earthlink.net/~patwynne/>

=_D_
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Alternative to FSpExchangeFiles?
Date: 08.05.02 19:17 (Wed, 8 May 2002 13:17:54 -0500)
From: Thomas Reed
>Actually, that's exactly what FSpExchangeFiles does.

I guess the documentation I'm looking at (which is admittedly old) is a
little unclear. It makes it sound like it's pulling the data out of each
file and shoving it into the other.

-Thomas

Personal web page: http://home.earthlink.net/~thomasareed/
My shareware: http://home.earthlink.net/~thomasareed/shareware/
REALbasic page: http://home.earthlink.net/~thomasareed/realbasic/
Pixel Pen web pub. guide: http://home.earthlink.net/~thomasareed/pixelpen/

How long a minute is depends on which side of the bathroom door you're on.

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Alternative to FSpExchangeFiles?
Date: 08.05.02 19:55 (Wed, 08 May 2002 20:55:23 +0200)
From: Jörg Pressel <
on 08.05.2002 19:41 Uhr, Patrick Wynne at <email address removed> wrote:

>> However, is there really a reason to use this? It does the exchange
>> by actually moving the data from each file to the other. This seems
>> awfully complicated when, for almost all purposes I can think of,
>> simply swapping the two files' positions (and possibly things like
>> names, creators, types, etc) would work just as well, and be less
>> prone to errors.
>
> Actually, that's exactly what FSpExchangeFiles does. It exchanges info
> from the catalog entry and (if the file is open) file control block,
> specifically: data/resource fork lengths (both logical and physical),
> starting allocation block, modification date, file ID, directory ID,
> and name.

I think I will do it the following way:

1. Check if FSpExchangeFiles works (this should be the safest way to update
a file that needed to be rewritten completely)

2. If it does not work I will copy all parameters by hand, as Thomas
suggested (position, long file name, type, creator, locked state, comment
and icon)

Sadly there seems to be no way to get around this...

Patrick: Are you sure that data/resource fork lengths are exchanged, if the
file is in use?

Thanks,

Jörg

____________________________________________
three-2-one interaktive Medien GmbH

<email address removed>
http://www.three-2-one.com
fon: +49 2151 319450

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Alternative to FSpExchangeFiles?
Date: 08.05.02 20:48 (Wed, 8 May 2002 12:48:25 -0700 (PDT))
From: Patrick Wynne
--- Jörg Pressel <<email address removed>> wrote:
> on 08.05.2002 19:41 Uhr, Patrick Wynne at <email address removed> wrote:
>
> >> However, is there really a reason to use this? It does the
> exchange
> >> by actually moving the data from each file to the other. This
> seems
> >> awfully complicated when, for almost all purposes I can think of,
> >> simply swapping the two files' positions (and possibly things like
> >> names, creators, types, etc) would work just as well, and be less
> >> prone to errors.
> >
> > Actually, that's exactly what FSpExchangeFiles does. It exchanges
> info
> > from the catalog entry and (if the file is open) file control
> block,
> > specifically: data/resource fork lengths (both logical and
> physical),
> > starting allocation block, modification date, file ID, directory
> ID,
> > and name.
>
> I think I will do it the following way:
>
> 1. Check if FSpExchangeFiles works (this should be the safest way to
> update
> a file that needed to be rewritten completely)
>
> 2. If it does not work I will copy all parameters by hand, as Thomas
> suggested (position, long file name, type, creator, locked state,
> comment
> and icon)
>
> Sadly there seems to be no way to get around this...
>
> Patrick: Are you sure that data/resource fork lengths are exchanged,
> if the file is in use?

Yup: "The FSpExchangeFiles function works on both open and closed
files." Here's the info it exchanges:
in the volume's catalog:
ioFlStBlk - first alloc block of data fork
ioFlLgLen - logical length of data fork
ioFlPyLen - physical length of data fork
ioFlRStBlk - first alloc block of resource fork
ioFlRLgLen - logical length of data fork
ioFlRPyLen - physical length of data fork
ioFlMdDat - date/time of last modification
in the file control block (if file is open):
fcbFlNum - file ID
fcbFlDirID - file's parent directory ID
fcbCName - file's name in volume catalog file

Patrick

=#DyPatrick Wynne
<http://home.earthlink.net/~patwynne/>

=_D_
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Alternative to FSpExchangeFiles?
Date: 08.05.02 20:00 (Wed, 8 May 2002 13:00:09 -0600)
From: Norman Palardy
FSpExchangeFiles changes the catalog entries, and moves nothing else
It is very nearly instantaneous and is a lot safer than doing all the
other things you mention, especially in the event of a system crash
while part way through the tasks you mention

On Wednesday, May 8, 2002, at 09:35 AM, Thomas Reed wrote:

>> I'm using the file exchange call "FSpExchangeFiles" with great
>> success, but
>> unfortunately this does not work with certain volumes (e.g. Fat32) -
>> error
>> -50 is returned ("Function not supported by volume").
>
> I have no experience with this, but you could try the slightly more
> complicated PBExchangeFiles routine. It may or may not work.
>
> However, is there really a reason to use this? It does the exchange by
> actually moving the data from each file to the other. This seems
> awfully
> complicated when, for almost all purposes I can think of, simply
> swapping
> the two files' positions (and possibly things like names, creators,
> types, etc) would work just as well, and be less prone to errors.
>
> -Thomas
>
> Personal web page:
> http://home.earthlink.net/~thomasareed/
> My shareware:
> http://home.earthlink.net/~thomasareed/shareware/
> REALbasic page:
> http://home.earthlink.net/~thomasareed/realbasic/
> Pixel Pen web pub. guide:
> http://home.earthlink.net/~thomasareed/pixelpen/
>
> Why are there Interstate highways in Hawaii?
>
> ---
> Subscribe to the digest:
> <mailto:<email address removed>>
> Unsubscribe:
> <mailto:<email address removed>>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>