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

Filesystem refactor and update #419

Merged
merged 44 commits into from
Jan 2, 2024

Conversation

a740g
Copy link
Contributor

@a740g a740g commented Dec 28, 2023

Closes #34
Closes #148

This pull request represents a significant refactoring effort to consolidate all filesystem-related APIs into their own translation unit inside libqb/. It now correctly handles all APIs, including some that were previously only implemented for Windows, across all supported platforms. This also auto-corrects directory separators in func__loadimage(), sub__saveimage(), func__sndopen() and func__loadfont().

The following two new functions were added:

' MS BASIC PDS 7.1 & VBDOS 1.0 DIR$() style function 
_FILES$([fileSpec$])
' Returns the Fully Qualified Name for a file / directory
_FULLPATH$(pathName$)

a740g and others added 30 commits December 10, 2023 01:16
@a740g a740g added bug Something isn't working enhancement New feature or request libqb-refactor Separating out libqb.cpp labels Dec 28, 2023
@a740g a740g self-assigned this Dec 28, 2023
@SteveMcNeill
Copy link
Member

I'm not so certain about the _FQN name. Honestly, I don't think it's a set of abbreviations that's going to mean a whole lot to the old foggies who tend to program in BASIC a lot. As much as I hate extra typing, I'd think a more verbose name might be needed here to maintain the general style as BASIC programming. Perhaps something like _FULLPATH. Or could these two functions somehow be combined into one?

_FILES$ (filespec$ , "verbose|brief")

Being picky over a command name seems almost petty in many ways, but this is very useful functionality. You want to try and make it as intuitive for the general user as possible, when you add it into the language.

@SteveMcNeill
Copy link
Member

(Even if it is kept as a short command name, shouldn't it at least be _FQFN for a Fully Qualified File Name? )

@a740g
Copy link
Contributor Author

a740g commented Dec 30, 2023

I'm not so certain about the _FQN name. Honestly, I don't think it's a set of abbreviations that's going to mean a whole lot to the old foggies who tend to program in BASIC a lot. As much as I hate extra typing, I'd think a more verbose name might be needed here to maintain the general style as BASIC programming. Perhaps something like _FULLPATH. Or could these two functions somehow be combined into one?

_FILES$ (filespec$ , "verbose|brief")

Being picky over a command name seems almost petty in many ways, but this is very useful functionality. You want to try and make it as intuitive for the general user as possible, when you add it into the language.

BASIC itself is not consistent with names. 😁 FRE, MK* and CV* are some that comes to mind. But I too am with you on verbose names. I initially thought of _FULLYQUALIFIEDNAME but quickly dropped it after looking at the number of characters. 😊 _FULLPATH sounds good though. We should not combine _FULLPATH and _FILES because we should allow folks to get canonicalized absolute pathnames without going thought the internal setup that _FILES does.

I'll change _FQN to _FULLPATH unless someone has any other suggestions.

@a740g
Copy link
Contributor Author

a740g commented Dec 30, 2023

(Even if it is kept as a short command name, shouldn't it at least be _FQFN for a Fully Qualified File Name? )

Well, it works for both file names and directory names. So, I not sure if we should use _FQFN. 🤷‍♂️

@SteveMcNeill
Copy link
Member

_FULLPATH sounds good to me, unless anyone else has a better suggestion. Otherwise, from what I can tell looking over this, it all looks good to me. :)

@a740g a740g merged commit 7aca957 into QB64-Phoenix-Edition:main Jan 2, 2024
@a740g a740g deleted the filesystem-refactor-and-update branch January 2, 2024 19:09
@a740g a740g mentioned this pull request Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request libqb-refactor Separating out libqb.cpp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Generic File System API into source files in libqb/ Investigate and fix KILL command behavior
3 participants