-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: a couple of file api tweaks #1407
Conversation
+1 on this, was thinking about suggesting the same for |
RFC: a couple of file api tweaks
Good. I think Matlab's fullfile also does the assembly in a way that addresses #1396, so that issue is relevant, too. |
We still need to go through and bikeshed the names of all the things in |
We also need to clean up the code itself. I've got new code for |
I've started putting together an api comparison table. Help and corrections are of course appreciated. |
Ah, yes. This is an excellent way to go about picking names. I can fill in the Ruby names later. |
Filled in the R names I knew offhand. As you can see, the names for the functions I added long ago are all derived from R, which is the major source of quirkiness in the names. |
I filled in the Ruby names for things. Would be handy to have the R and Matlab names completely filled in as well but this is an area where we should probably follow Python, Ruby and Perl more closely than R or Matlab. Also, I really don't think that downloading data from a URL belongs in this list. |
I filled in the MATLAB names for things as best I could, using this for inspiration. There's an awful lot of "N/A" entries, so if I've missed something feel free to replace it with what should be there. My guess is that MATLAB doesn't have things like |
The downside of leaning so heavily on the file system is that it isn't portable at all. My general inclination is to mimic a nice reasonable UNIX system (the way that Ruby's FileUtils class does) and then implement that behavior portably. |
I agree that the API should essentially replicate UNIX commands and system calls. |
Bump. We need to have a collective debate about the file API again. |
Right. I added a "Julia (proposal)" column which has what I think we should rename things to. I mostly stuck to whatever the UNIX shell command for doing things is called. The things that need a little debate are:
|
Having only
So I do think we should come up with names for those two concepts. I would also use a function like Riffing off I would prefer I would prefer I'm not sure why we need anything other than Why have both What is the status of Maybe this is a bad habit, but I basically never want |
I like all these name suggestions. |
My basic attitude is that we all know how UNIX commands work and we should make Julia's file manipulation commands be portable versions of those. A good first cut is just calling the corresponding UNIX commands, but we should switch to our own implementations eventually to avoid the overhead of spawning child processes and so that our behavior doesn't depend on the possibly idiosyncratic behavior of the system UNIX commands. As a corollary, I think that |
+1 to @johnmyleswhite's suggestions:
|
I've already done cwd=>pwd and isrooted=>isabspath here. I'm still sorting out the joinpath/splitpath pair. I think it's important to allow granular expansion of paths in various ways, which is why it makes sense to separate out |
Just to respond briefly to @JeffBezanson on |
Bump. We still need to agree on everything and implement it. |
Change
fullfile
to match matlab:In other words, define
const fullfile = file_path
.Rename
real_path -> realpath
, as it's a call to the POSIXrealpath
function, and that's what python, ruby, and perl call it.