Hi all! Community Julia!
user stories
- I would like as a user to list files, folders, directories like I would in shell script or bat-script in the Julia programming language, because it would be an easy way
- I would like just 2 ls/dir commands that do the same thing but join Linux and Windows users. So… Normally you are a Windows user you find the prompt and type dir and if you are a Linux/Unix user generally you type ls
So… here “my solution”:
before
julia> pwd()
"/home/JuliaUser"
after
julia> julia --dir #=> background: pwd()
"/home/JuliaUser"
sample 1: before
julia> cd(readdir, "/home/JuliaUser/Projects/julia")
34-element Array{String,1}:
".circleci"
".freebsdci.sh"
".git"
".gitattributes"
".github"
⋮
"test"
"ui"
"usr"
"usr-staging"
sample 1.1: after
julia> julia ls --readdir "/home/JuliaUser/Projects/julia" #=> background: cd(readdir, "/home/JuliaUser/Projects/julia")
".circleci"
".freebsdci.sh"
".git"
".gitattributes"
".github"
⋮
"test"
"ui"
"usr"
"usr-staging"
sample 1.2: after
julia> julia dir --readdir "/home/JuliaUser/Projects/julia" #=> background: cd(readdir, "/home/JuliaUser/Projects/julia")
".circleci"
".freebsdci.sh"
".git"
".gitattributes"
".github"
⋮
"test"
"ui"
"usr"
"usr-staging"
sample 1.3: after
julia> julia dir "/home/JuliaUser/Projects/julia" #=> background: cd("/home/JuliaUser/Projects/julia")
".circleci"
".freebsdci.sh"
".git"
".gitattributes"
".github"
⋮
"test"
"ui"
"usr"
"usr-staging"
sample 1.4: after
julia> julia ls "/home/JuliaUser/Projects/julia" #=> background: cd("/home/JuliaUser/Projects/julia")
".circleci"
".freebsdci.sh"
".git"
".gitattributes"
".github"
⋮
"test"
"ui"
"usr"
"usr-staging"
other case 1
julia> ./ #=> background: cd("/home/JuliaUser/Projects/julia")
".circleci"
".freebsdci.sh"
".git"
".gitattributes"
".github"
⋮
"test"
"ui"
"usr"
"usr-staging"
other case 2
julia> "/home/JuliaUser/Projects/julia" #=> background: cd("/home/JuliaUser/Projects/julia")
".circleci"
".freebsdci.sh"
".git"
".gitattributes"
".github"
⋮
"test"
"ui"
"usr"
"usr-staging"
other case 3
julia> "c://mytests//main.jl" #=> background: cd("c:/mytests/main.jl")
┌ Info:
└ Web Server starting at http://127.0.0.1:8888
my log
julia> ls
ERROR: UndefVarError: ls not defined
julia> dir
ERROR: UndefVarError: dir not defined
julia> path
ERROR: UndefVarError: path not defined
julia> dir
ERROR: UndefVarError: dir not defined
julia> julia main.jl
ERROR: syntax: extra token "routes" after end of expression
Stacktrace:
[1] top-level scope
@ none:1
julia> julia C:\mytests\main.jl
ERROR: syntax: extra token "C" after end of expression
Stacktrace:
[1] top-level scope
@ none:1
julia> C:\mytests\main.jl
ERROR: syntax: "\" is not a unary operator
Stacktrace:
[1] top-level scope
@ none:1
draft
julia> dir c:/mytests/main.jl # call powershell with command dir(Windows)
julia> ls c:/mytests/main.jl # call powershell with command ls(Linux/Unix)
julia> dir "c:/mytests/main.jl" # call powershell with command dir(Windows)
julia> ls "c:/mytests/main.jl" # call powershell with command ls(Linux/Unix)
why
- Makes life easier for those who came from shell script/batscript/python in Julia - Based on that, I made this proposal.
- I know that each programming language has its concept and specificity, but… listing files, folders and directories in Batchscript is trivial, you can use in the command line something like ls/dir - it just works the easy way… Julia should list things like directories, files, folders in an easy way like batscript - this is my initial opinion as someone who is studying Julia. Based on that, I made this proposal.
- I don’t have much knowledge in the Julia programming language, despite having taken programming courses in the Julia programming language, I have difficulties in understanding how Julia works… this can help me in this sense to better understand how Julia works if have ls/dir because … my initial difficulty was to list files, folders and directories with the Julia programming language. (Note: Over time… I can learn how to use Julia through experience) - I mentioned this because other people might feel like I do, they might be beginners and have been through the same problem as me. Based on that, I made this proposal.
- The point I want to make clear is from my experience as a beginner and someone interested in contributing to the Julia community. Based on that, I made this proposal.
- The files are called directly via the command line which makes it easier in Julia … Based on that, I made this proposal
references
- Filesystem · The Julia Language
- Batch Script Tutorial
- https:// www. atlassian .com/ agile/ project-management/user-stories