mirror of
https://github.com/goodhosts/hostsfile.git
synced 2026-04-27 07:25:53 +03:00
[GH-ISSUE #55] Feature Request: Method to Create Hostsfile from String #18
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hostsfile#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @spencercjh on GitHub (Jun 25, 2024).
Original GitHub issue: https://github.com/goodhosts/hostsfile/issues/55
I would like to express my gratitude for your contributions to the project. The two
Newmethods for reading from a file are extremely convenient and useful in my work.However, I've encountered a scenario where I need to read the contents of a hostsfile stored in memory. My workaround is to write the in-memory hostsfile to a temporary file and then use the existing API to read it. This process is not ideal and could be streamlined.
Therefore, I would like to propose a new feature: a
NewHostsFromStrmethod that allows the creation of a hostsfile directly from a string. Maybe we can just expose the existing test methodloadString?If this proposal aligns with the project's goals, I want to contribute to its implementation. I look forward to hearing your thoughts on this suggestion.
Thank you for considering my proposal.
@luthermonson commented on GitHub (Jun 25, 2024):
only concern i have with exposing it is probably all the funcs which need a file path to work e.g.
IsWritableandFlush. Would you expect to set thePathyourself for those to work or wouldNewHostsFromStrtake two params, the string and the path where you eventually want it?@spencercjh commented on GitHub (Jul 1, 2024):
I got your points. This may require reimplementing all the existing interfaces all over again.