Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

馃崉 com.livecode.file: Add "command argument _ parsed as file" #3318

Open
wants to merge 7 commits into
base: develop
Choose a base branch
Loading
from

Conversation

peter-b
Copy link
Contributor

@peter-b peter-b commented Nov 20, 2015

When using lc-run on Windows, there's the problem of correctly converting a command argument string that should be a filename into a correct LiveCode-style file path, so that it can be passed to the com.livecode.file APIs. At the moment, lc-run itself isn't quite right, because it only accepts LiveCode-style paths as arguments (and this is quite awkward for things like "getting the testsuite working").

This change set adds:

  • the current directory, a statement that evaluates to the current working directory
  • command argument _ parsed as file, which performs processing steps on its argument to convert it to a canonical LiveCode-style file path string

I've prototyped it in LCB, but once the behaviour is pinned down I want to translate it to C++ in libfoundation-system so that lc-run can use it during startup.

I'm not sure this is totally correct at the moment, because:

  • command argument element 1 of the command arguments parsed as file is totally unambiguous, quite useful, and horrifically ugly
  • arguably there should be an optional argument to the syntax that specifies the path to be treated as "current" for the purposes of parsing

Feedback very welcome!

Add `MCSFileGetCurrentDirectory()` for retrieving the process's
current working directory.
* Internal->native translation:
  * `\` characters are invalid
  * "Device" files (e.g. "NUL", "COM1") are invalid

* Native->internal translation:
  * `\` and `/` both map to `/`
  * "Device" files (e.g. "NUL", "COM1") are invalid
Add a new LCB expression, `the current directory`, that evaluates to
the LiveCode process's current working directory.
It's helpful to know which module is responsible for cyclic
dependencies!
@peter-b peter-b added this to the 8.0.0-rc-1 milestone Nov 20, 2015
@peter-b peter-b added the WIP label Nov 24, 2015
@peter-b peter-b modified the milestones: 8.0.0-dp-11, 8.0.0-rc-1 Dec 2, 2015
@peter-b peter-b modified the milestone: 8.0.0-rc-1 Mar 30, 2016
@peter-b peter-b closed this Apr 13, 2017
@peter-b peter-b deleted the lcb-stdlib/command-argument-file branch April 13, 2017 12:09
@peter-b peter-b changed the title com.livecode.file: Add "command argument _ parsed as file" [DEAD]com.livecode.file: Add "command argument _ parsed as file" Apr 13, 2017
@peter-b peter-b restored the lcb-stdlib/command-argument-file branch April 13, 2017 12:36
@peter-b peter-b reopened this Apr 13, 2017
@peter-b peter-b changed the title [DEAD]com.livecode.file: Add "command argument _ parsed as file" 馃崉 com.livecode.file: Add "command argument _ parsed as file" Apr 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.