Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua: extend pandoc.system module. #8184

Merged
merged 1 commit into from
Jul 15, 2022
Merged

Conversation

tarleb
Copy link
Collaborator

@tarleb tarleb commented Jul 14, 2022

The module now has the additional functions list_directory,
make_directory, and remove_directory. This makes it easier to write
cross-platform scripts that need to inspect or modify the file system.

@tarleb
Copy link
Collaborator Author

tarleb commented Jul 14, 2022

The module now has the additional functions `list_directory`,
`make_directory`, and `remove_directory`. This makes it easier to write
cross-platform scripts that need to inspect or modify the file system.
@tarleb tarleb force-pushed the lua-system-additions branch from 29304db to c31f109 Compare July 14, 2022 14:41
@jgm
Copy link
Owner

jgm commented Jul 15, 2022

I guess the main use for create/delete directory would be to create temporary directories? In that case, I wonder if it would be better to export functions that do that? I don't think the Lua interface contains general-purpose functions to create and delete files (or does it?), so it seems a bit odd to have such functions for directories.

@tarleb
Copy link
Collaborator Author

tarleb commented Jul 15, 2022

Lua has os.remove and os.rename. Files can be created with io.open, but directories cannot be created with standard library functions: the C standard only knows about files, not directories.

I imagine that folder creation might be handy for some custom writer authors. But I admit that I never needed any of those new functions, as the pandoc.system.with_temporary_directory function was enough for my use-cases.

@jgm jgm merged commit daef24f into jgm:master Jul 15, 2022
@tarleb tarleb deleted the lua-system-additions branch July 15, 2022 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants