# \#file

**URL:** https://discourse.julialang.org/tag/file/696.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [How to (efficiently) filter a file/stream on-the-fly?](https://discourse.julialang.org/t/how-to-efficiently-filter-a-file-stream-on-the-fly/122457)

<div class="topic-metadata">

**Author:** [@Abhro](https://discourse.julialang.org/u/Abhro)\
**Replies:** 6\
**Last updated:** [November 12, 2024, 12:12pm UTC](https://discourse.julialang.org/t/how-to-efficiently-filter-a-file-stream-on-the-fly/122457 "2024-11-12T12:12:53Z")

</div>

I have a fixed-width output file from a Fortran program, in a well-defined matrix format, except for the occasional lines which I can regard as comments. I would like to pass the file to something like DelimitedFiles.rea…

---

## [I want to read files with mingw64 in pluto notebooks](https://discourse.julialang.org/t/i-want-to-read-files-with-mingw64-in-pluto-notebooks/122343)

<div class="topic-metadata">

**Author:** [@selinguler94](https://discourse.julialang.org/u/selinguler94)\
**Replies:** 2\
**Last updated:** [November 7, 2024, 3:46pm UTC](https://discourse.julialang.org/t/i-want-to-read-files-with-mingw64-in-pluto-notebooks/122343 "2024-11-07T15:46:45Z")

</div>

output = read(mingw64 $FORTRANexe, String) I tried this but it doesn’t work. I am a windows user and I am trying to execute some fortran files in pluto, so I need mingw64. I failed to do it with wsl too, I’m starting to…

---

## [How to access mingw64 files in pluto notebook?](https://discourse.julialang.org/t/how-to-access-mingw64-files-in-pluto-notebook/122340)

<div class="topic-metadata">

**Author:** [@selinguler94](https://discourse.julialang.org/u/selinguler94)\
**Replies:** 0\
**Last updated:** [November 6, 2024, 4:35pm UTC](https://discourse.julialang.org/t/how-to-access-mingw64-files-in-pluto-notebook/122340 "2024-11-06T16:35:22Z")

</div>

I want to execute some fortran files so windows isn’t working for that, I have mingw64 to execute fortran but I can not access the files now. C:/Users/name /c/Users/name I replaced the first with the second but can’t …

---

## [Send file with HTTP.post](https://discourse.julialang.org/t/send-file-with-http-post/91932)

<div class="topic-metadata">

**Author:** [@sardinecan](https://discourse.julialang.org/u/sardinecan)\
**Replies:** 4\
**Last updated:** [October 22, 2024, 12:39pm UTC](https://discourse.julialang.org/t/send-file-with-http-post/91932 "2024-10-22T12:39:13Z")

</div>

Hi everyone, I’m looking to upload files via an API using Julia with the HTTP.jl package. Unfortunately, the API can’t retrieve my file, and I get an error: {“code”:500,“message”:“Unable to retrieve file from request.…

---

## [Readlines(filepath) and read(filepath,String) read different content](https://discourse.julialang.org/t/readlines-filepath-and-read-filepath-string-read-different-content/120777)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 15\
**Last updated:** [October 3, 2024, 9:52am UTC](https://discourse.julialang.org/t/readlines-filepath-and-read-filepath-string-read-different-content/120777 "2024-10-03T09:52:11Z")

</div>

Hey Julianners, This is fairly strange behavior as the readlines(fila\_path) doesn’t read the last enter from the file. Why is that? file\_path="test/playground/test/src/profile\_startup.jl" lines = readlines(file\_path, k…

---

## [Storage format for lots of strings](https://discourse.julialang.org/t/storage-format-for-lots-of-strings/115256)

<div class="topic-metadata">

**Author:** [@DoktorMike](https://discourse.julialang.org/u/DoktorMike)\
**Replies:** 7\
**Last updated:** [June 5, 2024, 9:50pm UTC](https://discourse.julialang.org/t/storage-format-for-lots-of-strings/115256 "2024-06-05T21:50:54Z")

</div>

Sorry to hijack this thread but I have another problem also with scale and was wondering if anyone has dealt with this scale before. I basically have 180 billion strings, SMILES, that I would like to store and work with …

---

## [\`open\` and \`include\` might point to different folders](https://discourse.julialang.org/t/open-and-include-might-point-to-different-folders/114538)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 3\
**Last updated:** [May 22, 2024, 3:15am UTC](https://discourse.julialang.org/t/open-and-include-might-point-to-different-folders/114538 "2024-05-22T03:15:40Z")

</div>

So, I have this set-up: I have my active Julia folder in VSCode. Within it I have a folder “subfolder”. I am running stuff in the Julia file “subfolder/my\_script.jl” I am running this script: open("testfile.jl", "w")…

---

## [How to save a lambdifyed (by SymEngine) expression to a file and load it in a new Session?](https://discourse.julialang.org/t/how-to-save-a-lambdifyed-by-symengine-expression-to-a-file-and-load-it-in-a-new-session/111165)

<div class="topic-metadata">

**Author:** [@Zaph](https://discourse.julialang.org/u/Zaph)\
**Replies:** 2\
**Last updated:** [April 15, 2024, 7:50am UTC](https://discourse.julialang.org/t/how-to-save-a-lambdifyed-by-symengine-expression-to-a-file-and-load-it-in-a-new-session/111165 "2024-04-15T07:50:26Z")

</div>

Hello, I posted this on Stackoverflow (https://stackoverflow.com/q/78087392/23508386) a few days ago but got ignored :c. So I decided to try my luck by copying it (inlcuding the Updates to the post I made on stack overfl…

---

## [How to read/process tuple data file](https://discourse.julialang.org/t/how-to-read-process-tuple-data-file/111754)

<div class="topic-metadata">

**Author:** [@tushargayan2324](https://discourse.julialang.org/u/tushargayan2324)\
**Replies:** 2\
**Last updated:** [March 18, 2024, 7:47am UTC](https://discourse.julialang.org/t/how-to-read-process-tuple-data-file/111754 "2024-03-18T07:47:30Z")

</div>

I have saved some data in Julia without any thought for formatting it. The saved file look something like the following; (\[0.123, 0.124, ... ,0.999\], \[0.222, 0.223, ..., 0.999\]) Link: Perc\_SARW\_analysis/data\_files/datf…

---

## [Error writing down a JSON file with JSON.jl](https://discourse.julialang.org/t/error-writing-down-a-json-file-with-json-jl/106028)

<div class="topic-metadata">

**Author:** [@PatrickeTownsend](https://discourse.julialang.org/u/PatrickeTownsend)\
**Replies:** 1\
**Last updated:** [November 10, 2023, 12:33pm UTC](https://discourse.julialang.org/t/error-writing-down-a-json-file-with-json-jl/106028 "2023-11-10T12:33:52Z")

</div>

Hello, I’m trying to export some data to a JSON format, the file is succesfully created with this function: function writeJSON() r = rand(3,3) N=3 data = \[Dict("x"=\> r\[i,1\],"y"=\> r\[i,2\],"z"=\>r\[i,3\]) for i=1…

---

## [Can I mimick finalizing for immutables / is an immutable file handler unfeasible?](https://discourse.julialang.org/t/can-i-mimick-finalizing-for-immutables-is-an-immutable-file-handler-unfeasible/104687)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 16\
**Last updated:** [October 15, 2023, 9:30am UTC](https://discourse.julialang.org/t/can-i-mimick-finalizing-for-immutables-is-an-immutable-file-handler-unfeasible/104687 "2023-10-15T09:30:20Z")

</div>

I can’t think of other uses for destructors/finalizers in a language without manual deallocations, so I’m using file-closing as an example. It seems to me that I could implement open to open a file and construct an immut…

---

## [Parallelizing file processing with the least amount of overhead](https://discourse.julialang.org/t/parallelizing-file-processing-with-the-least-amount-of-overhead/100169)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 2\
**Last updated:** [June 14, 2023, 9:58am UTC](https://discourse.julialang.org/t/parallelizing-file-processing-with-the-least-amount-of-overhead/100169 "2023-06-14T09:58:28Z")

</div>

Hey all! I wrote ViewReader a while ago and now thought adding some parallel file processing might be fun. ViewReader reads UInt8 (chars) to a buffer array so each thread could have its own buffer array. This might be ne…

---

## [Deserialize does not work when reopen](https://discourse.julialang.org/t/deserialize-does-not-work-when-reopen/92892)

<div class="topic-metadata">

**Author:** [@JNSDVD](https://discourse.julialang.org/u/JNSDVD)\
**Replies:** 2\
**Last updated:** [January 12, 2023, 7:55pm UTC](https://discourse.julialang.org/t/deserialize-does-not-work-when-reopen/92892 "2023-01-12T19:55:42Z")

</div>

Hey guys, I do not understand why the first code returns true while it does not work when I close the Jupyter Notebook, open it again and run only the second code. Of course the file XX.jls is still in the same folder …

---

## [Safe way to open new file and unlock an existing file to enable deletion, if it exists](https://discourse.julialang.org/t/safe-way-to-open-new-file-and-unlock-an-existing-file-to-enable-deletion-if-it-exists/88676)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 0\
**Last updated:** [October 13, 2022, 4:12pm UTC](https://discourse.julialang.org/t/safe-way-to-open-new-file-and-unlock-an-existing-file-to-enable-deletion-if-it-exists/88676 "2022-10-13T16:12:54Z")

</div>

Assume you have the habit to use the variable fid as an IOStream-variable and you are not sure, if the related file is still open (it might be that a process has crashed or you have forgotten to close the old not longer …

---

## [How do you get a Matrix back from a file?](https://discourse.julialang.org/t/how-do-you-get-a-matrix-back-from-a-file/88154)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 5\
**Last updated:** [October 3, 2022, 7:27pm UTC](https://discourse.julialang.org/t/how-do-you-get-a-matrix-back-from-a-file/88154 "2022-10-03T19:27:24Z")

</div>

When you pass a Matrix to write like so A = rand(UInt, 20,20) write("mat.bin", A) It works just fine. No errors. But how do you get the matrix back out? The docs show the string example which leads one to try Matri…

---

## [Cant read any kind of file exclusively in vscode](https://discourse.julialang.org/t/cant-read-any-kind-of-file-exclusively-in-vscode/87063)

<div class="topic-metadata">

**Author:** [@Can\_Atasayar](https://discourse.julialang.org/u/Can_Atasayar)\
**Replies:** 12\
**Last updated:** [September 12, 2022, 6:24pm UTC](https://discourse.julialang.org/t/cant-read-any-kind-of-file-exclusively-in-vscode/87063 "2022-09-12T18:24:19Z")

</div>

hi, my code cant read any kind of file while i am using vscode. i have tried all kinds of files and when i use jupyter notebook, i have no problem like this.

---

## [Does program interruption close open files automatically?](https://discourse.julialang.org/t/does-program-interruption-close-open-files-automatically/79774)

<div class="topic-metadata">

**Author:** [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 9:47am UTC](https://discourse.julialang.org/t/does-program-interruption-close-open-files-automatically/79774 "2022-05-18T09:47:16Z")

</div>

This post talks about not closing a file on purpose. What about unintentionally exiting the program? Will my files be blocked (I’m on Windows)? I seem to remember having some problems with MATLAB years ago, and I had t…

---

## [Handling multiple files at the same time](https://discourse.julialang.org/t/handling-multiple-files-at-the-same-time/80037)

<div class="topic-metadata">

**Author:** [@Drachta](https://discourse.julialang.org/u/Drachta)\
**Replies:** 6\
**Last updated:** [April 26, 2022, 10:49am UTC](https://discourse.julialang.org/t/handling-multiple-files-at-the-same-time/80037 "2022-04-26T10:49:13Z")

</div>

Hello, I wish to replace some occurrence in a file and save it under a new file. The following does what I need, but it reads the entire file before making the substitution. Is there a better way to do this ? some\_var…

---

## [\[ANN\] FileCmp.jl](https://discourse.julialang.org/t/ann-filecmp-jl/76919)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 2\
**Last updated:** [February 24, 2022, 12:14pm UTC](https://discourse.julialang.org/t/ann-filecmp-jl/76919 "2022-02-24T12:14:27Z")

</div>

FileCmp.jl is in the General Registry. FileCmp.filecmp(path1, path2) returns true if the files at path1 and path2 are byte-for-byte equal. There was a Discourse post on this a few years ago, linked from the README link…

---

## [Testing in Docker: Base.runtests("file") failed 🐋](https://discourse.julialang.org/t/testing-in-docker-base-runtests-file-failed/73060)

<div class="topic-metadata">

**Author:** [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Replies:** 1\
**Last updated:** [December 16, 2021, 12:15pm UTC](https://discourse.julialang.org/t/testing-in-docker-base-runtests-file-failed/73060 "2021-12-16T12:15:54Z")

</div>

Question: How can I run : Base.runtests("file") inside docker environments? Any best practice? My test command is failed - with the docker official Julia image. docker run -it --rm --privileged julia:1.7 julia -e …

---

## [FileIO without filesystem access?](https://discourse.julialang.org/t/fileio-without-filesystem-access/70429)

<div class="topic-metadata">

**Author:** [@sporklpony](https://discourse.julialang.org/u/sporklpony)\
**Replies:** 3\
**Last updated:** [October 27, 2021, 7:08am UTC](https://discourse.julialang.org/t/fileio-without-filesystem-access/70429 "2021-10-27T07:08:31Z")

</div>

I’d like to use Pluto.jl to create a small utility which processes and uploaded audio file. However, I’m unsure how to convert the uploaded audio file into a format usable with JuliaAudio’s ecosystem and SampledSignals.j…

---

## [How to play the audiobook .m4b file in julia?](https://discourse.julialang.org/t/how-to-play-the-audiobook-m4b-file-in-julia/69091)

<div class="topic-metadata">

**Author:** [@wuxinyu](https://discourse.julialang.org/u/wuxinyu)\
**Replies:** 3\
**Last updated:** [October 3, 2021, 11:27am UTC](https://discourse.julialang.org/t/how-to-play-the-audiobook-m4b-file-in-julia/69091 "2021-10-03T11:27:53Z")

</div>

I want to play a audio book file xxx.m4b in a web app, but I can’t find a package to handle the m4b file. I find a possible package called ffmpeg but I have no idea how to implement it. How can I play a audio book file i…

---

## [Reading in multiple matrices of different dimensions from .txt file](https://discourse.julialang.org/t/reading-in-multiple-matrices-of-different-dimensions-from-txt-file/68796)

<div class="topic-metadata">

**Author:** [@conorhassan](https://discourse.julialang.org/u/conorhassan)\
**Replies:** 6\
**Last updated:** [September 27, 2021, 7:05pm UTC](https://discourse.julialang.org/t/reading-in-multiple-matrices-of-different-dimensions-from-txt-file/68796 "2021-09-27T19:05:47Z")

</div>

Hi all, I have a .txt file containing information for 10 matrices of different dimensions. Each row of the .txt file corresponds to a row of a matrix, with whitespace distinguishing the elements. The matrices are seper…

---

## [Reading multiple integers from the same line without string manipulation](https://discourse.julialang.org/t/reading-multiple-integers-from-the-same-line-without-string-manipulation/65572)

<div class="topic-metadata">

**Author:** [@burntclaw](https://discourse.julialang.org/u/burntclaw)\
**Replies:** 1\
**Last updated:** [July 30, 2021, 8:55pm UTC](https://discourse.julialang.org/t/reading-multiple-integers-from-the-same-line-without-string-manipulation/65572 "2021-07-30T20:55:53Z")

</div>

Hi all! I’m relatively new to Julia. I’m wondering if there is a way to read a line of integers like this in a file without using readline(s) and then parsing and manipulating the resulting string. The text file I want t…

---

## [How do I find the size of a file?](https://discourse.julialang.org/t/how-do-i-find-the-size-of-a-file/61845)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 2\
**Last updated:** [May 26, 2021, 11:14am UTC](https://discourse.julialang.org/t/how-do-i-find-the-size-of-a-file/61845 "2021-05-26T11:14:20Z")

</div>

Hello, I have a file (“path/to/my/file/myfile”), and I wishes to know its size. I try filesize("path/to/my/file/myfile") but only get 0 in output (which definitely is not its size). How do I get the filesize?
