# \#filesystem

**URL:** https://discourse.julialang.org/tag/filesystem/397.md

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

---

## [Designing a Paths Julep](https://discourse.julialang.org/t/designing-a-paths-julep/124335)

<div class="topic-metadata">

**Author:** [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Replies:** 198\
**Last updated:** [February 8, 2026, 4:36pm UTC](https://discourse.julialang.org/t/designing-a-paths-julep/124335 "2026-02-08T16:36:51Z")

</div>

Prompted by a gripe I made on Slack, thoughts I’ve had on paths have coalesed into the start of a Julep and a prototpye. At this stage, I’d love to get wider input on the idea and help shoring it up into a solid propo…

---

## [Removing directory contents recursively](https://discourse.julialang.org/t/removing-directory-contents-recursively/128761)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 6\
**Last updated:** [May 6, 2025, 4:31pm UTC](https://discourse.julialang.org/t/removing-directory-contents-recursively/128761 "2025-05-06T16:31:50Z")

</div>

Hi all, still struggling with this. I want to run command rm -rf /path/to/dir/\*, so that I delete the content but not the dir itself. I get this julia\> Base.run(\`rm -rf $(ReproData.root())/code/"\*"\`) Process(\`rm -rf '/…

---

## [Copying folder including subfolders](https://discourse.julialang.org/t/copying-folder-including-subfolders/104065)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 10\
**Last updated:** [April 16, 2025, 8:02pm UTC](https://discourse.julialang.org/t/copying-folder-including-subfolders/104065 "2025-04-16T20:02:33Z")

</div>

Is there an easy way to copy the contents of one folder, including all subfolders, to another folder? It seems that cp() supported the recursive keyword at one point, but not anymore.

---

## [How to execute a bit of Julia code/function from a specific directory](https://discourse.julialang.org/t/how-to-execute-a-bit-of-julia-code-function-from-a-specific-directory/127916)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 2\
**Last updated:** [April 11, 2025, 9:07am UTC](https://discourse.julialang.org/t/how-to-execute-a-bit-of-julia-code-function-from-a-specific-directory/127916 "2025-04-11T09:07:44Z")

</div>

I have a folder (“MyFolder”) that looks something like: MyFolder: data.ext read\_data.jl next, “read\_data.jl” looks ike this: using DataImporter data = DataImporter.import("data.ext") Somewhere else I then run data…

---

## [Pkg performance on Windows Dev Drive](https://discourse.julialang.org/t/pkg-performance-on-windows-dev-drive/126948)

<div class="topic-metadata">

**Author:** [@visr](https://discourse.julialang.org/u/visr)\
**Replies:** 1\
**Last updated:** [March 14, 2025, 12:19pm UTC](https://discourse.julialang.org/t/pkg-performance-on-windows-dev-drive/126948 "2025-03-14T12:19:32Z")

</div>

I recently moved my Julia depot to a Dev Drive and am quite happy with the results, so I’m sharing my experience. This contrived benchmark sped up from 176 to 8 seconds: for i in 1:100\_000 open("file.txt", "w") do …

---

## [Splitpath/joinpath for non-native paths?](https://discourse.julialang.org/t/splitpath-joinpath-for-non-native-paths/123336)

<div class="topic-metadata">

**Author:** [@Dan](https://discourse.julialang.org/u/Dan)\
**Replies:** 9\
**Last updated:** [December 2, 2024, 11:44pm UTC](https://discourse.julialang.org/t/splitpath-joinpath-for-non-native-paths/123336 "2024-12-02T23:44:40Z")

</div>

This problem highlights a problem in Base.Filesystem. The natural way to do this conversion would be to use something along this line: joinpath( splitpath("a\\\\b\\\\c"; arch=Base.Arch.Windows); arch=Base.Arch.Linux )…

---

## [Safe overwriting of files](https://discourse.julialang.org/t/safe-overwriting-of-files/117758)

<div class="topic-metadata">

**Author:** [@fabiangans](https://discourse.julialang.org/u/fabiangans)\
**Replies:** 12\
**Last updated:** [August 16, 2024, 12:39pm UTC](https://discourse.julialang.org/t/safe-overwriting-of-files/117758 "2024-08-16T12:39:37Z")

</div>

I have a workflow where I repeatedly need to overwrite files with new content. I think the easiest way to overwrite a file is to use write(filename,newcontent). My question is how safe this function is against data loss…

---

## [Find all files named "findthis.csv" in nested subfolders of "rootfolder"](https://discourse.julialang.org/t/find-all-files-named-findthis-csv-in-nested-subfolders-of-rootfolder/118096)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 8\
**Last updated:** [August 12, 2024, 5:40pm UTC](https://discourse.julialang.org/t/find-all-files-named-findthis-csv-in-nested-subfolders-of-rootfolder/118096 "2024-08-12T17:40:47Z")

</div>

I am trying to do what the title says and collect the file paths into a vector but having trouble. I would use find rootfolder -name findthis.csv in bash. readdir can only read one level deep, so I am trying to find a so…

---

## [How to suggest path based on user input](https://discourse.julialang.org/t/how-to-suggest-path-based-on-user-input/117966)

<div class="topic-metadata">

**Author:** [@Shuvo\_Barman](https://discourse.julialang.org/u/Shuvo_Barman)\
**Replies:** 1\
**Last updated:** [August 8, 2024, 7:56pm UTC](https://discourse.julialang.org/t/how-to-suggest-path-based-on-user-input/117966 "2024-08-08T19:56:46Z")

</div>

I am creating a GUI using “Gtk” and in this GUI there is a field where user inputs path, I want to suggest path based on user input. But i am unable to do so, Any idea how i can suggest path to user based on the input s/…

---

## [\`touch\` function errors where touch command in terminal works](https://discourse.julialang.org/t/touch-function-errors-where-touch-command-in-terminal-works/116510)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 0\
**Last updated:** [July 2, 2024, 9:54am UTC](https://discourse.julialang.org/t/touch-function-errors-where-touch-command-in-terminal-works/116510 "2024-07-02T09:54:59Z")

</div>

I am unable to update the modification time of a folder using touch: julia\> mkdir("temp") "temp" julia\> mtime("temp") 1.7199137885920577e9 julia\> touch("temp") ERROR: IOError: open("temp", 65, 438): illegal operation …

---

## [\`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")…

---

## [\[ANN\] Shelly.jl -- cd, ls, ll and more Unix in the Julia REPL mode](https://discourse.julialang.org/t/ann-shelly-jl-cd-ls-ll-and-more-unix-in-the-julia-repl-mode/100657)

<div class="topic-metadata">

**Author:** [@martin.auer](https://discourse.julialang.org/u/martin.auer)\
**Replies:** 7\
**Last updated:** [April 23, 2024, 1:18pm UTC](https://discourse.julialang.org/t/ann-shelly-jl-cd-ls-ll-and-more-unix-in-the-julia-repl-mode/100657 "2024-04-23T13:18:06Z")

</div>

Hi all, happy to announce Shelly.jl, a tiny helper package to let you swiftly navigate the file system from within the Julia REPL mode, and without having to type any special characters. More info on the Github README;…

---

## [Isfile() for JLD2 appears to be giving segmentation faults / bus errors on a computer cluster](https://discourse.julialang.org/t/isfile-for-jld2-appears-to-be-giving-segmentation-faults-bus-errors-on-a-computer-cluster/113019)

<div class="topic-metadata">

**Author:** [@andrewkhardy](https://discourse.julialang.org/u/andrewkhardy)\
**Replies:** 5\
**Last updated:** [April 17, 2024, 4:15pm UTC](https://discourse.julialang.org/t/isfile-for-jld2-appears-to-be-giving-segmentation-faults-bus-errors-on-a-computer-cluster/113019 "2024-04-17T16:15:27Z")

</div>

I’m posting a question because I’m not sure if I’m making a silly mistake, or if there’s something a bit more subtle going wrong. I am running a Julia script on a HPC cluster. One aspect of this script is that it checks…

---

## [Directory issue](https://discourse.julialang.org/t/directory-issue/111055)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 3\
**Last updated:** [March 2, 2024, 9:10pm UTC](https://discourse.julialang.org/t/directory-issue/111055 "2024-03-02T21:10:20Z")

</div>

This is a little code: const file\_path::String = "./try" file\_out = open(file\_path, "w") a::Int64 = 1 write(file\_out, a) close(file\_out) file\_in = open(file\_path, "r") b::Int64 = read(file\_in, Int64) close(file\_in) pri…

---

## [Right way to run external program in parallel?](https://discourse.julialang.org/t/right-way-to-run-external-program-in-parallel/109490)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 3\
**Last updated:** [January 31, 2024, 4:21am UTC](https://discourse.julialang.org/t/right-way-to-run-external-program-in-parallel/109490 "2024-01-31T04:21:21Z")

</div>

I could not figure this out all day, until finally this answer saved me: run(\`bash -c """cd temp\_dir && some\_cmd"""\`) Is there a better way to do this? In particular I want to run a program designed to log results s…

---

## [Nastran OP2 and BDF](https://discourse.julialang.org/t/nastran-op2-and-bdf/108425)

<div class="topic-metadata">

**Author:** [@Jacob53101](https://discourse.julialang.org/u/Jacob53101)\
**Replies:** 1\
**Last updated:** [January 25, 2024, 8:17pm UTC](https://discourse.julialang.org/t/nastran-op2-and-bdf/108425 "2024-01-25T20:17:39Z")

</div>

I’m trying to work with nx nastran bdf and op2 files using julia. There’s a library in python called pyNastran that can parse these nastran files really well and save them as hdf5 files. My plan is to read these hdf5 fil…

---

## [Best way to root a pipeline directory structure inside of a package](https://discourse.julialang.org/t/best-way-to-root-a-pipeline-directory-structure-inside-of-a-package/107275)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 9\
**Last updated:** [December 9, 2023, 7:44pm UTC](https://discourse.julialang.org/t/best-way-to-root-a-pipeline-directory-structure-inside-of-a-package/107275 "2023-12-09T19:44:15Z")

</div>

I’ve written some bioinformatics analysis scripts in julia. They are fast and impressed everyone! :heart\_eyes: Now I would like to share them with my collaborators. They act inside a pipeline that took many years to deve…

---

## [Error when file is not found](https://discourse.julialang.org/t/error-when-file-is-not-found/106665)

<div class="topic-metadata">

**Author:** [@Barvid](https://discourse.julialang.org/u/Barvid)\
**Replies:** 12\
**Last updated:** [November 24, 2023, 8:21pm UTC](https://discourse.julialang.org/t/error-when-file-is-not-found/106665 "2023-11-24T20:21:30Z")

</div>

Hello All I am sure there is super simple elegant solution to this, but I cant find it, so sorry for the silly question. my code loads a csv file and sometimes the file is not there, so need to handle that. I found 2 w…

---

## [Error while moving files :name too long (ENAMETOOLONG)](https://discourse.julialang.org/t/error-while-moving-files-name-too-long-enametoolong/106377)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 2\
**Last updated:** [November 17, 2023, 9:09pm UTC](https://discourse.julialang.org/t/error-while-moving-files-name-too-long-enametoolong/106377 "2023-11-17T21:09:14Z")

</div>

I am getting name too long (ENAMETOOLONG) when i try to move file from one folder to another. My code is as given below :yawning\_face: \`for i in 1:length(IO) mat=match(r".+beta-(\\d.\\d+)\_betaerr(\\d.\\d+)",IO\[i\]) if…

---

## [Storing and accessing large jagged array with julia](https://discourse.julialang.org/t/storing-and-accessing-large-jagged-array-with-julia/45973)

<div class="topic-metadata">

**Author:** [@Luapulu](https://discourse.julialang.org/u/Luapulu)\
**Replies:** 33\
**Last updated:** [October 31, 2023, 11:10am UTC](https://discourse.julialang.org/t/storing-and-accessing-large-jagged-array-with-julia/45973 "2023-10-31T11:10:50Z")

</div>

I have a bunch of data, currently stored in 2000 seperate .csv files. Each file countains thousands of events, where each event starts with three numbers, one of which specifies the length of the event. All following row…

---

## [Starting Julia debugger in a given directory](https://discourse.julialang.org/t/starting-julia-debugger-in-a-given-directory/104282)

<div class="topic-metadata">

**Author:** [@wujinq](https://discourse.julialang.org/u/wujinq)\
**Replies:** 1\
**Last updated:** [September 26, 2023, 10:20pm UTC](https://discourse.julialang.org/t/starting-julia-debugger-in-a-given-directory/104282 "2023-09-26T22:20:30Z")

</div>

I’m writing a script that read files in the same folder that contains the script itself. So the script starts with something like let wfn\_file\_name = "WFN\_co.h5", eqp\_file\_name = "eqp\_co.dat", itrs\_max = 1 …

---

## [List files in a directory, meeting certain conditions](https://discourse.julialang.org/t/list-files-in-a-directory-meeting-certain-conditions/103197)

<div class="topic-metadata">

**Author:** [@chadagreene](https://discourse.julialang.org/u/chadagreene)\
**Replies:** 2\
**Last updated:** [August 25, 2023, 5:50pm UTC](https://discourse.julialang.org/t/list-files-in-a-directory-meeting-certain-conditions/103197 "2023-08-25T17:50:40Z")

</div>

In MATLAB, I can list all the files in a directory like this: f = dir('/Users/myname/path'); and I can limit results to the files that meet certain conditions like this: f = dir('/Users/myname/path/StartsWith\*.txt');…

---

## [Best way to find the last saved file in a folder?](https://discourse.julialang.org/t/best-way-to-find-the-last-saved-file-in-a-folder/99737)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 4\
**Last updated:** [June 1, 2023, 6:10pm UTC](https://discourse.julialang.org/t/best-way-to-find-the-last-saved-file-in-a-folder/99737 "2023-06-01T18:10:06Z")

</div>

Hi! I have a folder where new files are constantly being added and I would like to know the best way to find the name of the last file saved. Thus far I am doing something like files = readdir(folder, join = true) las…

---

## [Isdir in Windows 67 times slower than Linux](https://discourse.julialang.org/t/isdir-in-windows-67-times-slower-than-linux/96436)

<div class="topic-metadata">

**Author:** [@Jeremy](https://discourse.julialang.org/u/Jeremy)\
**Replies:** 16\
**Last updated:** [March 23, 2023, 12:31pm UTC](https://discourse.julialang.org/t/isdir-in-windows-67-times-slower-than-linux/96436 "2023-03-23T12:31:09Z")

</div>

I need to list a large number of files and parse their names. My function works but the performance in Windows is 67 times slower despite running on a more powerful computer. The number of files is unknown and the user c…

---

## [Best way to check if a folder is empty on MacOS given ".DS\_Store" files](https://discourse.julialang.org/t/best-way-to-check-if-a-folder-is-empty-on-macos-given-ds-store-files/96276)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 0\
**Last updated:** [March 18, 2023, 9:23am UTC](https://discourse.julialang.org/t/best-way-to-check-if-a-folder-is-empty-on-macos-given-ds-store-files/96276 "2023-03-18T09:23:07Z")

</div>

Just wondering what the best way to check if a folder is empty on MacOs? Given that there always seems to be a “.DS\_Store” file is empty("folder") returns false even when there are no files in the folder. The only way…

---

## [Verify if a daily file has been created](https://discourse.julialang.org/t/verify-if-a-daily-file-has-been-created/95912)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 6\
**Last updated:** [March 12, 2023, 11:27pm UTC](https://discourse.julialang.org/t/verify-if-a-daily-file-has-been-created/95912 "2023-03-12T23:27:47Z")

</div>

Suppose you have a series of data files that are added daily and named in the following format. folder/name-01-01-23.csv folder/name -01-02-23.csv . . . folder/name-03-10-23.csv What is the best way to verify if the …

---

## [Copy only modified files to destination folder](https://discourse.julialang.org/t/copy-only-modified-files-to-destination-folder/95176)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 2\
**Last updated:** [February 25, 2023, 10:19am UTC](https://discourse.julialang.org/t/copy-only-modified-files-to-destination-folder/95176 "2023-02-25T10:19:56Z")

</div>

I am wondering, if there is a package or a command to copy only new files to a destination folder (one way synchronization). I have tried to find something here and on GitHub, but failed :frowning:

---

## [Zip folder using Julia](https://discourse.julialang.org/t/zip-folder-using-julia/69565)

<div class="topic-metadata">

**Author:** [@RaulDurand](https://discourse.julialang.org/u/RaulDurand)\
**Replies:** 8\
**Last updated:** [January 13, 2023, 7:41am UTC](https://discourse.julialang.org/t/zip-folder-using-julia/69565 "2023-01-13T07:41:47Z")

</div>

Hi! How to zip an entire folder using Julia? I tried using ZipFile with no success. Thanks.

---

## [Is there any package supporting Samba? or is there any workaround?](https://discourse.julialang.org/t/is-there-any-package-supporting-samba-or-is-there-any-workaround/90357)

<div class="topic-metadata">

**Author:** [@Bondan000](https://discourse.julialang.org/u/Bondan000)\
**Replies:** 2\
**Last updated:** [November 28, 2022, 2:36am UTC](https://discourse.julialang.org/t/is-there-any-package-supporting-samba-or-is-there-any-workaround/90357 "2022-11-28T02:36:44Z")

</div>

Hi all, I am trying to host a simple Dash.jl based webapp in an Openshift cloud platform. The webapp has to fetch a file from a windows share! I can’t access the file within openshift! with samba connector i be able to …

---

## [Is there a built-in function to get the size of a folder?](https://discourse.julialang.org/t/is-there-a-built-in-function-to-get-the-size-of-a-folder/76762)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 7\
**Last updated:** [October 27, 2022, 5:28pm UTC](https://discourse.julialang.org/t/is-there-a-built-in-function-to-get-the-size-of-a-folder/76762 "2022-10-27T17:28:02Z")

</div>

I saw that there are stat and filesize, but I don’t see a recursive option. Is there a small package or another function that can give me the cumulative size of all files in a folder? Another thing I am not sure about …

[Next page](https://discourse.julialang.org/tag/filesystem/397.md?match_all_tags=true&page=1&tags%5B%5D=filesystem)
