Author Topic: Loading a .e file from a read-only directory?  (Read 468 times)

rowbearto

  • Senior Community Member
  • Posts: 2162
  • Hero Points: 132
Loading a .e file from a read-only directory?
« on: January 13, 2022, 07:04:32 pm »
I have a .e file of macros I want to share with my colleagues. Our standard distribution method places it into a read-only directory.

When I try loading this .e file from the read-only directory I get an error:'

Quote
Unable to create output file: <macro>.ex

Does this mean I have to instruct my colleagues to copy this file to a writable directory where they can load it?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6273
  • Hero Points: 484
Re: Loading a .e file from a read-only directory?
« Reply #1 on: January 13, 2022, 08:59:31 pm »
Yes, that's the only work around.

Graeme

  • Senior Community Member
  • Posts: 2718
  • Hero Points: 337
Re: Loading a .e file from a read-only directory?
« Reply #2 on: January 14, 2022, 05:35:48 am »
You could distribute the ex file as well as the *.e file, or maybe make the directory temporarily writable.

rowbearto

  • Senior Community Member
  • Posts: 2162
  • Hero Points: 132
Re: Loading a .e file from a read-only directory?
« Reply #3 on: January 14, 2022, 02:05:37 pm »
How to get a user to load a .ex file? Would I need 2 different .ex files due to some users running the previous SlickEdit release?

Can't make the directory writable.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3606
  • Hero Points: 480
Re: Loading a .e file from a read-only directory?
« Reply #4 on: January 14, 2022, 02:20:18 pm »
You could use the hotfix mechanism using the create-hotfix command, it takes a list of macro files as arguments.
Code: [Select]
   create-hotfix work/mymacro.e work/yourmacro.e work/ourmacro.e work/theirmacro.e

Clark might give you instructions on how to create a plugin.

Graeme

  • Senior Community Member
  • Posts: 2718
  • Hero Points: 337
Re: Loading a .e file from a read-only directory?
« Reply #5 on: January 14, 2022, 08:08:49 pm »
xretrace help has some information on how to create a plugin.
I didn't test the plugin much with slick V25.

Graeme

  • Senior Community Member
  • Posts: 2718
  • Hero Points: 337
Re: Loading a .e file from a read-only directory?
« Reply #6 on: January 15, 2022, 10:51:10 am »
How to get a user to load a .ex file? Would I need 2 different .ex files due to some users running the previous SlickEdit release?

Can't make the directory writable.

Yes you would need two different ex files.  If the ex file has a newer time/date than the source then slick won't recompile it.  You could get some undesirable behaviour if the wrong ex file is used.  You can check the version at compile time like this
#if __VERSION__ < 25

and at runtime like this
   if (_version_compare(_version(), "23.0.0.0") > 0)  {
      // version 23 onwards have a built in command
      load_named_layout();
      return;
   }