Molebox problem with copyfileCommunity Forums/Developer Stations/Molebox problem with copyfile
| This is really strange, Copyfile worked some time ago, but right now it seems to fail for some unknown reason.|
I have tested it several times, it really seems it's molebox. I even tried to read the file to a bank, then save it as a second file instead, THis works and may be a work around. Noless, it used to work with copyfile (copy a packed file to the harddrive) some time ago, so what's up?!?
| I just tried a tiny test program in BlitzMax 1.22 (haven't updated yet):|
CopyFile "1.txt", "2.txt"with MoleBox Pro 2.5.12 (just noticed that I need to update this, too <g>). I tried this once where "1.txt" was in the same folder as the MoleBoxed .exe but wasn't included in its archive, and once where it was included in the package but wasn't in the folder outside the package. CopyFile created a copied "2.txt" both times.
I then tried the same program in Blitz3D 1.98 and it worked with "1.txt" in the folder but not where it was packed instead of in the archive (which sounds like what you're describing).
I also tried using uppercase filenames (I once had problem with MoleBox converting ReadLine-ed text to all-uppercase, though that particular issue was fixed in a MoleBox update). It still didn't work in the B3D version, while it still worked in the BlitzMax version (and uppercased the copied filename correctly).
Neither using a separate data section nor changing "Make packed files visible for standard OpenFile dialog" made any difference in the B3D version. Neither did using a debug build in B3D.
So, it does look like while BlitzMax's CopyFile works with MoleBox, Blitz3D's version currently doesn't. If you contact March on the http://devforum.teggo.com/viewforum.php?f=2 forum, they might be able to fix this with a MoleBox update like that which fixed my B3D uppercase text file problem.
| Here's an old (9. juni 2005) Molebox support answer I got on this: |
> The reason of this behavior is that MoleBox does not intercept
> system function 'CopyFileA()' used by Blitz Basic's CopyFile command.
> If necessary, you can copy the contents of a text file using a
> sequence of commands instead of single CopyFile command. You'll have
> to create an empty file, read the contents of the original file, and
> write the data to the new file.
> Please note that you may also need to use absolute file names in a
> Blitz Basic program which will be moleboxed. For example, instead of
> "original.txt" file name, you have to use (AppDir + "original.txt"),
> where AppDir is a string path for the application directory - I'm not
> sure for the syntax.
| Ok ,thanks. The strange part is, I got this implemented in an app that was compiled with blitz3D 1.98 some months ago and then it used to work! |