dim f1, f2 as FolderItem
dim f2name as String
dim debugReadFromFile as BinaryStream
f1 = GetOpenFolderItem("") // select an existing file with a
long name: 060126A_sameFileWithVeryLongFilenameToMessUpRB.tif
f2name = f1.Name + ".itk"
// create a new folderitem and copy the original
f2 = f1.Parent.Child(f2name)
f1.CopyFileTo f2
// try to open it: returns nil
debugReadFromFile=f2.OpenAsBinaryFile(false)
This never fails for short filenames, and curiously, if you re-run
this a second time (and now the f2 copy already exists from the
previous run, OpenAsBinaryFile now returns a non-nil stream.
This bug is similar to;
http://www.realsoftware.com/feedback/viewreport.php?reportid=fjyqngvk
I say similar because my original code was failing with a custom
write to binary stream, and not a copyfileto, so it seems any write
to a stream with a long filename is problematic. I've had a lot of
trouble on and off with long filenames.
There is a workaround, but this took me several hours to track down,
and this bug has been open since last june. I wish RS would get on
these things.
P.
------------------------------------------------------------------------
-------
Peter K. Stys, MD
Professor of Medicine(Neurology), Senior Scientist
Ottawa Health Research Institute, Div. of Neuroscience
Ottawa Hospital / University of Ottawa
Ontario, CANADA
tel: (613)761-5444
fax: (613)761-5330
http://www.ohri.ca/profiles/stys.asp
------------------------------------------------------------------------
-------
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|