Cross-network renaming issue in 10.4
Cross-network renaming issue in 10.4
- Subject: Cross-network renaming issue in 10.4
- From: "Dan Smith" <email@hidden>
- Date: Fri, 13 May 2005 16:00:42 -0400
The test application mentioned below is available for download from:
http://world.std.com/~dpbsmith/CrossNetworkRenameBug.app.zip
Entered as bug 4118699, 13-May-2005 03:49 PM Daniel P. B. Smith:
Summary:
Many pieces of prepress software, including ECRM's CtServer, use "hot folders"
hosted on Windows systems. Client software running on the Mac copies files to
the hot folder. The remote software continuously scans the hot folder for
incoming files and removes them for processing. Our specific problem involves a
piece of client software we must work with, which is not under our control and
to which we do not have source, which copies the file into the hot folder with
a .TMP extension. When the copy is complete, it generates filenames in a
numeric sequence until it finds one that does not exist (e.g. TIFF04.TIF) and
renames the .TMP file.
We are seeing a completely reproducible problem in 10.4 8A428 which does not
occur in 10.3.8 or 10.3.9. The problem occurs when, say, TIFF01.TIF,
TIFF02.TIF, TIFF03.TIF, TIFF04.TIF, and TIFF05.TIF exist in the hot folder and
the processing program running on the Windows box removes TIFF01.TIF for
processing. The client software copies a TMP file, sees that the file
TIFF01.TIF does not exist, and attempts to rename $TIFF00$.TMP to TIFF01.TIF.
There is no competing activity going on in the directory except for the client
software copying files to TMP and renaming them to unused names, and the remove
server software removing them.
Even though TIFF01.TIF truly does not exist at the time when the rename is
attempted, under 10.4 the rename attempt errors out. This suggests an
inconsistency between the view of the remote directory as seen by whatever
layer of software performs the renaming and whatever layer of software looks to
see what files exist in the directory.
I have attached a REALbasic application that allows the problem to be
demonstrated easily, without requiring either the real client or server
software. Incidentally, the demonstration works fine on either a remote Mac
using Mac OS X or a remote Windows system.
The provider of the client software gives us this description of the API calls
they are using:
The TIFF plugin initially creates a temporary file in the target
folder, with a name generated from the template "$TIFF<2unique>$.TMP",
resulting in names such as: $TIFF00$.TMP, $TIFF01$.TMP etc.
The TIFF plugin on Mac OS X creates the temporary file with
'FSCreateFileUnicode' - its 'whichInfo' argument does not include
kFSCatInfoPermission - Only the 'textEncodingHint' and 'finderInfo'
members of the 'FSCatalogInfo' structure are set.
The data fork is then opened with'FSOpenFork' with a 'permissions'
argument of 'fsWrPerm'.
On successful completion, the file is then closed and renamed to it's
final name using the RIP's Plugin-Function-Interface file rename function.
The exact behaviour of this depends upon the RIP, but on OS X at present I
believe it ends up using 'FSRenameUnicode'.
Steps to Reproduce:
-----------------
1) Obtain two Macintoshes running Mac OS X 10.4. We'll call one the "local"
system and one the "remote" system.
2) On the remote system turn on Windows Sharing and enable it for an admin
account. Let's say the remote system is named "remote" and the admin account is
named "d_smith." In the admin's home directory create an empty folder named
"test"
3) On the local system, mount the "admin" share so that a volume named "admin"
appears on the desktop. Open it in the Finder and find the "test" folder.
4) On the local system, download and expand the attached
CrossNetworkRenameBug.app.zip. Launch it. A window named "Cross-network
renaming bug demonstrator" opens.
5) Drag the "test" folder to the area labelled "Drag a Remote Folder Here." The
path ADMIN:test appears.
6) Press the "Setup files" button. You should see output like this:
reated D_SMITH:test:FILE1.txt
Created D_SMITH:test:FILE2.txt
Created D_SMITH:test:FILE3.txt
Created D_SMITH:test:FILE4.txt
Created D_SMITH:test:FILE5.txt
Done.
7) Go to the remote system D_SMITH
and delete the file D_SMITH:test:FILE3.txt
Delete them using the Finder at the remote system system itself.
Do NOT delete them using the local machine's Finder.
8) When you have done this, press the "Rename" button.
Expected Results:
---------------
Because the file FILE4.txt does not exist, it should be possible to rename the
file. The expected program output is:
Initially:
D_SMITH:test:FILE2.txt exists
D_SMITH:test:FILE4.txt does not exists
About to try renaming
After renaming attempt:
D_SMITH:test:FILE2.txt does not exist
D_SMITH:test:FILE4.txt exists
Results are as expected.
Actual Results:
------------
A message box appears saying "unexpected results." The program logs this output:
Initially:
D_SMITH:test:FILE2.txt exists
D_SMITH:test:FILE4.txt does not exists
About to try renaming
error 101 renaming D_SMITH:test:FILE2.txt
After renaming attempt:
D_SMITH:test:FILE2.txt exists
D_SMITH:test:FILE4.txt does not exists
Unexpected results:
Unexpected error code 101 and D_SMITH:test:FILE2.txt should not exist and
D_SMITH:test:FILE4.txt should exist.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden