# ArgumentError while using \`\`\`enumerate(CSV.File())\`\`\`: "..." is not a valid file

**URL:** <https://discourse.julialang.org/t/argumenterror-while-using-enumerate-csv-file-is-not-a-valid-file/20129>\
**Category:** General Usage\
**Created:** [January 26, 2019, 3:46pm UTC](https://discourse.julialang.org/t/argumenterror-while-using-enumerate-csv-file-is-not-a-valid-file/20129 "2019-01-26T15:46:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [January 26, 2019, 3:46pm UTC](https://discourse.julialang.org/t/argumenterror-while-using-enumerate-csv-file-is-not-a-valid-file/20129/1 "2019-01-26T15:46:00Z")

</div>

```julia
julia> for (i,row) in enumerate(CSV.File("/home/devel/Desktop/SDP_me/example/input/misc.csv"))
           println(i)
       end
ERROR: ArgumentError: "/home/devel/Desktop/SDP_me/example/input/misc.csv" is not a valid file
Stacktrace:
 [1] #File#1(::Int64, ::Bool, ::Int64, ::Nothing, ::Int64, ::Nothing, ::Bool, ::Nothing, ::Bool, ::Array{String,1}, ::String, ::String, ::Bool, ::Char, ::Nothing, ::Nothing, ::Char, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Dict{Type,Type}, ::Symbol, ::Bool, ::Bool, ::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Type, ::String) at /home/devel/.julia/packages/CSV/eWuJV/src/CSV.jl:135
 [2] Type at /home/devel/.julia/packages/CSV/eWuJV/src/CSV.jl:135 [inlined]
 [3] top-level scope at ./none:0

julia> for (i,row) in enumerate(CSV.File("/home/devel/Desktop/SDP_me/example/input/map.csv"))
           println(i)
       end
1

```

I checked the file, it’s there safe and sound. So I was deeply confused. (cry…) Can anyone please help me?

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [January 27, 2019, 5:08am UTC](https://discourse.julialang.org/t/argumenterror-while-using-enumerate-csv-file-is-not-a-valid-file/20129/2 "2019-01-27T05:08:22Z")

</div>

That error comes from the very first argument check in the function and it uses `Base.isfile` to check if the file input is indeed a valid file, so it seems that something is indeed wrong with your file (you can check this yourself by just doing `isfile(file)` from the REPL).

I mean, from the shell itself, can you navigate to that directory and do `ls` to list the contents of the directory? Maybe it’s a read permission issue? Just throwing out ideas here.
