How do I set the current working directory for Dyalog?

The Dyalog "Knowledgebase". This forum is read-only
Forum rules
The FAQ is a read-only forum which is in general updated only by employees of Dyalog Ltd. It replaces the FAQ page which existed under http://www.dyalog.com. Rather than rejecting other posts to this forum, such posts will be put in a moderation queue, and moved to a more appropriate forum.

How do I set the current working directory for Dyalog?

Postby Vince|Dyalog on Tue Jun 25, 2013 2:04 pm

Motivation for setting current directory:
If you do not have write permission for the current directory, you will not be able to save a workspace or continue workspace in that directory.

You can get an error message like the following:
)save myws
Can’t save – file could not be created.

You could specify a full path for the save command.

)save c:\tmp\myws

You can set the current directory in the shortcut that starts Dyalog by right clicking on it and choosing Properties. On the Shortcut tab, edit the “Start in” field.

You can also set it under program control by using the SetCurrentDirectory function from the supplied files workspace or by using the ]cd user command:


Code: Select all

⍝⍝⍝  Check current directory
]cd
d:\18ws

⍝⍝⍝  Change it
      ]cd c:\tmp\
d:\18ws

      ]cd
c:\tmp

⍝⍝⍝  Or:

)load files
C:\Program Files (x86)\Dyalog\Dyalog APL 13.2 Unicode\ws\files saved Wed Jan 30 18:14:48 2013
     Files.SetCurrentDirectory 'c:\tmp\'
     Files.GetCurrentDirectory
c:\tmp
Vince|Dyalog
 
Posts: 434
Joined: Wed Oct 01, 2008 9:39 am

Return to Frequently Asked Questions (FAQ)

Who is online

Users browsing this forum: No registered users and 1 guest