summaryrefslogtreecommitdiff
path: root/drivers/unix/dir_access_unix.cpp
AgeCommit message (Collapse)Author
2023-01-16Linux/BSD: Add LINUXBSD_ENABLED define for non X11-related checksRémi Verschelde
2023-01-05One Copyright Update to rule them allRémi Verschelde
As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
2022-10-05Merge pull request #66720 from qarmin/unintialized_memoryRémi Verschelde
Remove usage of unitialized variables
2022-10-03Unix: Remove now unnecessary I/O defines, cleanupRémi Verschelde
- `LIBC_FILEIO_ENABLED` wasn't defined anywhere, even in _other platforms_. - `NO_NETWORK` is also never defined. It probably isn't enough anyway to disable network APIs in the current codebase. - `UNIX_SOCKET_UNAVAILABLE` is never defined in this code but used by some other platforms, clarify that. - `NO_STATVFS` can be removed as Android supports it since API level 19, which is our current min SDK level. It's also only used for `DirAccessUnix::get_space_left()` which is anyway overridden by `DirAccessJAndroid::get_space_left()` so it shouldn't make a difference. * Fixed documentation for `DirAccess.get_space_left()`. - `NO_FCNTL` is likely also a remnant of early Android days, in current NDK r23 it seems to be available. Also cleaned up unused `fcntl.h` includes. - `NO_ALLOCA` is never defined, and we use alloca in many places now.
2022-10-01Remove usage of unitialized variablesRafał Mikrut
2022-08-29Rename String `plus_file` to `path_join`Aaron Franke
2022-07-25Code quality: Fix header guards consistencyRémi Verschelde
Adds `header_guards.sh` bash script, used in CI to validate future changes. Can be run locally to fix invalid header guards.
2022-07-07Allows parsing of invalid UTF-16 surrogates (can be encountered in Windows ↵bruvzg
filenames) and some non-standard UTF-8 variants, makes Unicode parse errors more verbose.
2022-07-05Add Desktop to file dialog drive on UnixShlomi
2022-07-05Add full support for Android scoped storage.Fredia Huya-Kouadio
This was done by refactoring directory and file access handling for the Android platform so that any general filesystem access type go through the Android layer. This allows us to validate whether the access is unrestricted, or whether it falls under scoped storage and thus act appropriately.
2022-04-11Make FileAccess and DirAccess classes reference counted.bruvzg
2022-02-16Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde
Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-15Add / to the unix shortcut drive listHaoyu Qiu
Also made `get_current_drive()` to pick the longest match on Unix.
2021-12-09Replace String comparisons with "", String() to is_empty()Nathan Franke
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
2021-08-29Rename String::is_rel_path to String::is_relative_pathWilson E. Alvarez
2021-05-31Fix `Directory::get_space_left()` result on macOS and Linux.bruvzg
2021-05-22Add symlink API to the DirAccess (on macOS and Linux).bruvzg
2021-05-17Make all file access 64-bit (uint64_t)Pedro J. Estébanez
This changes the types of a big number of variables. General rules: - Using `uint64_t` in general. We also considered `int64_t` but eventually settled on keeping it unsigned, which is also closer to what one would expect with `size_t`/`off_t`. - We only keep `int64_t` for `seek_end` (takes a negative offset from the end) and for the `Variant` bindings, since `Variant::INT` is `int64_t`. This means we only need to guard against passing negative values in `core_bind.cpp`. - Using `uint32_t` integers for concepts not needing such a huge range, like pages, blocks, etc. In addition: - Improve usage of integer types in some related places; namely, `DirAccess`, core binds. Note: - On Windows, `_ftelli64` reports invalid values when using 32-bit MinGW with version < 8.0. This was an upstream bug fixed in 8.0. It breaks support for big files on 32-bit Windows builds made with that toolchain. We might add a workaround. Fixes #44363. Fixes godotengine/godot-proposals#400. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2021-04-30Fix `url_decode` with mixed percent-encoding/Unicode strings. Treat Unix ↵bruvzg
drive names as UTF-8 encoded.
2021-03-23FileDialog: add Back/Forward buttons, add message for inaccessible folders.bruvzg
2021-01-28Unify URI encoding/decoding and add to C#Aaron Franke
http_escape and percent_encode have been unified into uri_encode, and http_unescape and percent_decode have been unified into uri_decode.
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-09-28Hides special folders in FileDialog for macOSHaoyu Qiu
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-03Improve UX of drive lettersPedro J. Estébanez
Namely, move the drive dropdown to just the left of the path text box and don't include the former in the latter. This improves the UX on Windows. In the UNIX case, since its concept of drives is (ab)used to provide shortcuts to useful paths, its dropdown is kept at the original location.
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-07-29Optimize DirAccessUnix::get_next() for some file systemsHadrien
On some file systems, like ext4 on Linux, readdir() gives enough information to determine the entry type in order to avoid doing a stat() system call. Use this information and call stat() only if necessary: for file systems that do not support this feature and for links.
2019-07-21Revert "Optimize DirAccessUnix::get_next() for some file systems"Geequlim
2019-07-17Optimize DirAccessUnix::get_next() for some file systemsHadrien
On some file systems, like ext4 on Linux, readdir() gives enough information to determine the entry type in order to avoid doing a stat() system call. Use this information and call stat() only if necessary.
2019-07-01Merge pull request #29815 from NilsIrl/plus_file_1Rémi Verschelde
Replace ` + "/" + ` with `String::file_add()`
2019-06-26Some code changed with Clang-Tidyqarmin
2019-06-23Replace ` + "/" + ` with `String::file_add()`Nils ANDRÉ-CHANG
2019-01-21Add function to obtain filesystem type from DirAccess.Juan Linietsky
Change EditorFileSystem to not use directory modification times on FAT32, fixes #20946
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-11-27Attempt to avoid breaking people's workflows on the change from ↵Juan Linietsky
8ba0d513fa0068a241a25fbb6db09315fa3309cc
2018-11-22Added missing path verification on Unix, closes #20762Juan Linietsky
2018-10-07Safer getcwd in DirAccessFabio Alessandrelli
Fix [-Wunused-result]
2018-10-03Fix warnings in Android platformRémi Verschelde
Fixes the following Clang 7 warnings: ``` platform/android/os_android.h:240:16: warning: 'OS_Android::native_video_play' hides overloaded virtual function [-Woverloaded-virtual] platform/android/os_android.h:241:15: warning: 'OS_Android::native_video_is_playing' hides overloaded virtual function [-Woverloaded-virtual] platform/android/audio_driver_opensl.cpp:104:3: warning: suggest braces around initialization of subobject [-Wmissing-braces] platform/android/audio_driver_opensl.cpp:129:10: warning: unused variable 'numOutputs' [-Wunused-variable] platform/android/audio_driver_opensl.cpp:130:11: warning: unused variable 'deviceID' [-Wunused-variable] platform/android/java_glue.cpp:795:10: warning: unused variable 'clsio' [-Wunused-variable] platform/android/java_glue.cpp:890:12: warning: unused variable 'gob' [-Wunused-variable] platform/android/java_glue.cpp:592:13: warning: unused variable 'resized' [-Wunused-variable] platform/android/java_glue.cpp:593:13: warning: unused variable 'resized_reload' [-Wunused-variable] modules/mobile_vr/mobile_vr_interface.cpp:401:8: warning: unused variable 'aspect_ratio' [-Wunused-variable] drivers/unix/dir_access_unix.cpp:394:2: warning: THIS IS BROKEN [-W#warnings] ```
2018-09-13Merge pull request #21982 from luzpaz/misc-typosRémi Verschelde
Misc. typos
2018-09-12Misc. typosluz.paz
Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
2018-08-10Revert "added get_creation_time function for gdscript"Juan Linietsky
2018-05-16added get_creation_time function for gdscriptDaniele Giuliani
2018-02-21Fix get_drive (bookmarks) in linux not workingPoommetee Ketson
2018-02-18[X11] Improving error detection in move_to_trashIskustvo
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.