[Vm-dev] [commit][2953] In sqFileOpen() ensure that Mac file characteristics are set only when a new file is created

Eliot Miranda eliot.miranda at gmail.com
Sat Jun 7 00:50:50 UTC 2014


Hi VM folks.

    when you check-in a change to platforms/Cross/plugins try and remember
to update  platforms/Cross/plugins/sqPluginsSCCSVersion.h too to reflect
the change in the version info displayed by the VM.  You do this using the
horrible

svn propset checkindate "`date`"
platforms/Cross/plugins/sqPluginsSCCSVersion.h

An example of this is in the scripts/svnci script:
svn propset checkindate "`date`" platforms/Cross/vm/sqSCCSVersion.h

When you do this the Cog VMs accurately inform you of their version:

 ~/oscogvm/products/coglinuxht/squeak -version
4.0-2950 #4 Fri Jun  6 17:18:14 PDT 2014 gcc 4.1.2 [Production VM]
CoInterpreter VMMaker.oscog-eem.746 uuid:
cc4961d3-e629-4e28-b308-88eab314a8c9 Jun  6 2014
StackToRegisterMappingCogit VMMaker.oscog-eem.757 uuid:
c4908baa-712c-4cb6-a606-5bde992e9582 Jun  6 2014
VM: r2950 http://www.squeakvm.org/svn/squeak/branches/Cog Date: 2014-06-06
15:23:16 -0700
Plugins: r2954 http://squeakvm.org/svn/squeak/trunk/platforms/Cross/plugins
Linux mcqfes 2.6.18-128.el5 #1 SMP Wed Jan 21 10:44:23 EST 2009 i686 i686
i386 GNU/Linux
plugin path: /home/eliot/oscogvm/products/coglinuxht/lib/squeak/4.0-2950
[default:
/home/eliot/all/Cog/oscogvm/products/coglinuxht/lib/squeak/4.0-2950/]



On Fri, Jun 6, 2014 at 4:36 PM, <commits at squeakvm.org> wrote:

>
> Revision: 2953
> Author:   lewis
> Date:     2014-06-06 16:36:45 -0700 (Fri, 06 Jun 2014)
> Log Message:
> -----------
> In sqFileOpen() ensure that Mac file characteristics are set only when a
> new file is created
>
> Modified Paths:
> --------------
>     trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
>
> Modified: trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
> ===================================================================
> --- trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
> 2014-06-06 22:37:22 UTC (rev 2952)
> +++ trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
> 2014-06-06 23:36:45 UTC (rev 2953)
> @@ -251,10 +251,21 @@
>                         if (getFile(f) == NULL)
>                                 setFile(f, fopen(cFileName, "ab"));
>                         if (getFile(f) != NULL) {
> +                           /* New file created, set Mac file
> characteristics */
>                             char type[4],creator[4];
>                                 dir_GetMacFileTypeAndCreator(sqFileName,
> sqFileNameSize, type, creator);
>                                 if (strncmp(type,"BINA",4) == 0 ||
> strncmp(type,"????",4) == 0 || *(int *)type == 0 )
>
> dir_SetMacFileTypeAndCreator(sqFileName, sqFileNameSize,"TEXT","R*ch");
> +                       } else {
> +                               /* If the file could not be opened
> read/write and if a new file
> +                                  could not be created, then it may be
> that the file exists but
> +                                  does not permit read access. Try
> opening as a write only file,
> +                                  opened for append to preserve existing
> file contents.
> +                               */
> +                               setFile(f, fopen(cFileName, "ab"));
> +                               if (getFile(f) == NULL) {
> +                                       return
> interpreterProxy->success(false);
> +                               }
>                         }
>                 }
>                 f->writable = true;
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20140606/7922f93a/attachment.htm


More information about the Vm-dev mailing list