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

os: add split_path() #23532

Merged
merged 4 commits into from
Jan 21, 2025
Merged

os: add split_path() #23532

merged 4 commits into from
Jan 21, 2025

Conversation

kbkpbot
Copy link
Contributor

@kbkpbot kbkpbot commented Jan 20, 2025

This will help user get the filename without ext.

split_path will split opath into (dir,filename,ext).
Examples:

dir,filename,ext := os.split_path('/usr/lib/test.so')
assert [dir,filename,ext] == ['/usr/lib','test','.so']

Bug fix:
os.base(), os.file_name(), os.dir() all support both windows/non-windows path at the same time.

Copy link

Connected to Huly®: V_0.6-21960

vlib/os/os_test.c.v Outdated Show resolved Hide resolved
vlib/os/os.v Outdated Show resolved Hide resolved
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 2a69b7c into vlang:master Jan 21, 2025
67 of 68 checks passed
@kbkpbot kbkpbot deleted the os-add-split-path branch January 21, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants