I think the main reason that readxlsheets & writexlsheets require the
explicit use of jpath, while most of the file operations now don't, is
historical.  The standard file operations available in the default
session all use jpath under-the-covers as part of the fboxname verb.
   fboxname=: <@jpath_j_@(8 u: >) ::]

Prior to J7 fboxname (and therefore file operations) did not include jpath.
   fboxname=: ([: < 8 u: >) ::]

In an attempt to be dependency-free, tables/tara has internalised a
lot of functionality including some of these basic verb definitions.
   fboxname_biffread_=: ([: < 8 u: >) ::]

But it still uses the definitions prior to J7.

On Mon, May 21, 2012 at 7:33 AM, Piet de Jong <piet.dej...@mq.edu.au> wrote:
> Thanks again for your help.
>
> Here is a mini session
>
>   fexist '~/documents/junk4.xls'
> 1
>   (i. 2 2) writexlsheets  '~/documents/junk4.xls'
> writexlsheets: error creating/writing later sheets
> 0
>   (i. 2 2) writexlsheets jpath  '~/documents/junk4.xls'
> 1
>
> So things are fine if I use "jpath".    I understand that jpath
> converts any path into an absolute file path.
>
> My question is why "jpath" is needed.   Why not implement everything
> similar to other file type operations (such as fexist) with the
> ability to work with relative file paths etc.    This can be achieved
> with eg
>
>   xlwrite=: writexlsheets jpath
>   (i. 2 2) xlwrite  '~/documents/junk4.xls'
> 1
>
>
> On Mon, May 21, 2012 at 12:29 AM, bill lam <bbill....@gmail.com> wrote:
>>
>>  '~/Documents/junk3.xls' is usually not legal file name in file system,
>> the jpath verb convert it into an absolute path. Try type inside
>> your session
>>
>> jpath '~/Documents/junk3.xls'
>>
>> I suspect your problem is un-related to Tara, try verify you get
>> write permission on those folders, eg.
>>
>> '...' 1!:2 <'~/Documents/junk3.xls'
>> '...' 1!:2 <jpath '~/Documents/junk3.xls'
>> '...' 1!:2 <'/Mactinosh HD/junk.xls'
>>
>> Вск, 20 Май 2012, Piet de Jong писал(а):
>>> Thanks for your help and suggestions.
>>>
>>> I can get it to work now using "jpath".
>>>
>>> But I don't understand why jpath is needed.    For example if I define
>>>
>>> xlwrite=:writexlsheets jpath
>>>
>>> The using xlwrite allows me to point to any folder/file for writing eg
>>>
>>>    (i.2 2) xlwrite '~/Documents/junk3.xls'
>>>
>>> writes the file "junk3.xls" to the Documments folder etc.
>>>
>>> But what is the point of "jpath"?
>>>
>>>
>>> On Sun, May 20, 2012 at 10:17 AM, bill lam <bbill....@gmail.com> wrote:
>>> > I tested it ok on linux jconsole and gtkide but no Mac available for 
>>> > testing.
>>> >
>>> > Will it be related to file permission? Try if if will work for your
>>> > home directly.
>>> >
>>> >    (i.5 7) writexlsheets jpath '~/junk.xls'
>>> >
>>> > Вск, 20 Май 2012, Piet de Jong писал(а):
>>> >> I run Jgtk701 on a mac.
>>> >>
>>> >> Tara works fine except that I cannot specify/control where
>>> >> spreadsheets are written or read - ie the directory information.
>>> >>
>>> >> For example
>>> >>
>>> >>    (i.5 7) writexlsheets 'junk.xls'
>>> >>
>>> >> writes the spreasheet into the 'j701' foloder.    When I try and
>>> >> change things to eg
>>> >>
>>> >>    (i.5 7) writexlsheets '/Mactinosh HD/junk.xls'
>>> >> writexlsheets: error creating/writing later sheets
>>> >> 0
>>> >>
>>> >> This no matter whatever folder/directory information I give it.
>>> >> Any attempt to modify the folder/directory information gives an error as 
>>> >> above.
>>> >>
>>> >> Please help.
>>> >> ----------------------------------------------------------------------
>>> >> For information about J forums see http://www.jsoftware.com/forums.htm
>>> >
>>> > --
>>> > regards,
>>> > ====================================================
>>> > GPG key 1024D/4434BAB3 2008-08-24
>>> > gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
>>> > ----------------------------------------------------------------------
>>> > For information about J forums see http://www.jsoftware.com/forums.htm
>>>
>>>
>>>
>>> --
>>> Piet de Jong
>>> --------------------------------------------------
>>> View my current research at
>>> http://ssrn.com/author=619154
>>> --------------------------------------------------
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>> --
>> regards,
>> ====================================================
>> GPG key 1024D/4434BAB3 2008-08-24
>> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to