New topic: Integrate File and recreate it on disk
<http://forums.realsoftware.com/viewtopic.php?t=47501> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message pascal4 Post subject: Integrate File and recreate it on diskPosted: Thu Apr 04, 2013 9:19 am Joined: Fri Jun 26, 2009 4:27 am Posts: 52 Hi, I need to integrate a file (export filter definition) for an external software into the final build and be able to regenerate the file to disk. To illustrate this: The user selects the menu 'Generate Export Filter for X' and the file is generated on his disk. The file can then be used by the software X. I already tried to drag the file (Xexport) to the project and it is shown with the alias icon. The I create a binary stream and write the file out to the disk like this: DIM f As FolderItem=GetSaveFolderItem(FileTypes1.ExportFilter,"Export Filter") IF f=NIL THEN RETURN DIM tout As BinaryStream tout=BinaryStream.Create(f) IF tout=NIL THEN RETURN tout.Write(Xexport) tout.Close This works fine, but the Mac Creator and Mac Type are not correct. When setting them with an external tool the file works well. Another question ... are files dragged to the project compiled into the final project and work even when the original file is no more present? Best regards. Top DaveS Post subject: Re: Integrate File and recreate it on diskPosted: Thu Apr 04, 2013 9:24 am Joined: Sun Aug 05, 2007 10:46 am Posts: 4721 Location: San Diego, CA Files (text, binary, images etc) are stored in the Application Bundle (OSX) AS-IS. They are not "compiled" or altered in any way. They simply exist in the bundle, and are part of the deployment (in OSX the "APP" is in reality a special type of folder). You can in fact access them AS FILES, and they can be COPIED from inside the bundle to an external location (there are other topics on this forum with more specifics on how to do this). However... DO NOT EVER alter the contents of one of these files while it is INSIDE the bundle. That is a big type no-no. And do not put files into the bundle EXCEPT via the IDE prior to compiling the project. The compiler must account for them (and their CRC) as part of the application validation process. _________________ Dave Sisemore MacPro, OSX Lion 10.7.4 RB2012r1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
