Jyrki Gadinger
679dcbe6dd
fix(filesystem): avoid multiple directory separators when joining paths
...
On Windows using paths prefixed with `\\?\` to allow using long file
names require the rest of the path to be valid, a path like
`\\?\C:\Users\\jyrki` will fail in different ways...
This helps with making setting/removing permission ACLs more reliable.
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-07-29 10:30:18 +02:00
Matthieu Gallien
ff72dd32fb
fix(logs): less verbose logs
...
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-06-26 10:24:33 +02:00
Matthieu Gallien
dac875ab89
fix(readonly): better handling of ACL on read-only files on windows
...
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-06-18 12:08:29 +02:00
Matthieu Gallien
0723016769
fix(windows): when deleting a file use safe long windows path
...
will avoid getting a content access denied error because some paths is
too long for windows default limit and has to use the special syntax for
long path
see https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-06-02 12:15:32 +02:00
Matthieu Gallien
584c81321f
fix(delete): optimize item exist checks when propagating from server
...
QFileInfo::exists(filename) is the fastest method
alos avoid creating too many QFileInfo instances when we need it for
multiple purposes
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-05-22 09:05:32 +02:00
Matthieu Gallien
8f0be0c5db
fix(readonly): use native separator in paths before calling windows API
...
we need platform native separators for file paths that will be used in
native Windows platform specific APIs
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-05-09 17:37:02 +02:00
Andy Scherzinger
7655efa230
docs(reuse): Migrate to SPDX header
...
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-05-06 09:49:30 +02:00
Matthieu Gallien
f3bc7cf7b0
fix(filesystem): use platform specific API to make a file read-only
...
on Windows we may fail to mark a file read-only be read-write again
using high level API
switch to use of low level C API from Microsoft
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-28 11:45:54 +02:00
Matthieu Gallien
fcee45d2b5
fix(filesystem): log more permissions when deleting a file fails
...
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-28 11:45:54 +02:00
Matthieu Gallien
0eacdcee70
fix(filesystem): warn when trying to delete an already deleted file
...
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-24 10:29:20 +02:00
Matthieu Gallien
2b8f129680
fix: Revert "stop using QFile api to delete a single local file"
...
This reverts commit 58d28ab330 .
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-24 10:29:16 +02:00
Matthieu Gallien
4dfe6ae988
fix: use safer conversion from QString to filesystem::path
...
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-23 15:00:50 +02:00
Matthieu Gallien
7c00807de7
feat: better logs when a file cannot be removed
...
should log the reason why a file cannot be deleted
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-23 15:00:50 +02:00
Matthieu Gallien
a071ea76ea
refactor(logs): improve logs around deletions and permissions
...
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-18 16:32:26 +02:00
Matthieu Gallien
83e9dbb617
fix(read only folder): allow renaming new file inside read-only folders
...
needed to download a new file inside a read-only folder
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-18 16:32:26 +02:00
Matthieu Gallien
58d28ab330
stop using QFile api to delete a single local file
...
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-08 20:50:52 +02:00
Matthieu Gallien
ca34d86efb
always make the file we try to delete be read-write as required
...
on windows you must only delete read-write files
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-07 11:48:17 +02:00
Jyrki Gadinger
179c80ed45
fix deletion of .lnk files on Windows with paths containing special characters
...
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-02-10 09:14:33 +01:00
Matthieu Gallien
b2b5fb793c
ensure no crash due to uncatched exception from std c++ lib
...
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-01-02 10:20:27 +01:00
Matthieu Gallien
1f32d1f9d7
prevent crash by catching more exception types from c++ std lib
...
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-01-02 10:20:27 +01:00
Matthieu Gallien
b6b0a9d4a3
prevent implicit hydration when setting file permissions on shortcuts
...
we were using specialized API to set the file permissions on the windows
shortcut and later falling back to the generic code path due to the
mising return
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-22 09:50:08 +01:00
Matthieu Gallien
bac5a1d200
properly catch std::filesystem exceptions
...
will prevent std::terminate from being called with uncatched exceptions
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-10-08 11:52:58 +02:00
alex-z
f70d1c1079
Support Windows .lnk files with VFS Cf API.
...
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-07-10 10:29:21 +02:00
Claudio Cambra
9811d35a96
Return bool from FileSystem::setFileReadOnlyWeak depending on whether permission change was actually made or not
...
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-07 16:25:19 +08:00
Claudio Cambra
d3eefee25a
Replace custom moveToTrash solution with Qt QFile::moveToTrash
...
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-21 00:07:59 +08:00
Dimitri Papadopoulos
9d830e94f9
Fix typos found by codespell
...
Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2023-06-21 08:47:13 +02:00
Matthieu Gallien
c0549c5c03
fix issues reported by compiling windows code with clang-tidy
...
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-22 16:50:20 +01:00
rakekniven
af49a7993a
Fixed placeholder numbering
...
Fix for #3812
Reported at Transifex.
Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
2021-09-20 11:39:51 +02:00
allexzander
fc75b94524
Fix clang-tidy errors.
...
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-07-30 06:21:05 +00:00
Valdnet
7ebbb499e0
l10n: Replace apostrophe with double quotation
...
Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
2021-07-30 06:21:05 +00:00
Hannah von Reth
22c634935b
Run expansive assert only in dev builds
2021-06-16 10:54:07 +00:00
Hannah von Reth
03182ea714
Use longWinPath in more places
2021-06-16 10:54:07 +00:00
Hannah von Reth
d014293f6d
Ensure pathtoUNC is called with an absolute path
2021-06-16 10:54:06 +00:00
allexzander
d6ddf595f8
Fix review comments.
...
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-06-08 09:25:43 +00:00
allexzander
5dd310c21c
Fix review comments.
...
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-06-08 09:25:43 +00:00
allexzander
b150de9106
Fix review comments. Also consider exclude.lst.
...
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-06-08 09:25:43 +00:00
allexzander
bb55232e8e
VFS freeze fix. Treat .sync-exclude.lst as a non-virtual file always.
...
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-06-08 09:25:43 +00:00
Hannah von Reth
adb56178b9
GetLastError() needs to be called when the error happens
...
qDebug might clear it already
Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2021-05-06 07:35:59 +00:00
Hannah von Reth
713a429675
Add todo for Qt 5.15
2020-12-30 16:17:47 +01:00
Hannah von Reth
1144473f5d
Cleanup pathtoUNC and its test
2020-12-30 16:17:46 +01:00
Kevin Ottens
c57eff6fd8
Please the clang-tidy overlord
...
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 11:01:53 +01:00
Hannah von Reth
563b347567
csync: apply strict QString handling
2020-12-15 10:59:16 +01:00
Hannah von Reth
2887a93c40
Win: Use full Windows paths in file watcher and improve logging
2020-12-15 10:59:16 +01:00
Hannah von Reth
7fa7bc54c4
Win: Move hresultToQString from vfs plugin to Utility::formatWinError
2020-12-15 10:59:16 +01:00
Olivier Goffart
bf6e4174c8
Move the checksum related routine from FileSystem to checksum, where they belong
2020-12-15 10:58:05 +01:00
Stephan Beyer
ea16804751
Replace NULL by nullptr in all C++ files
...
We keep NULL in the pure C files in src/csync/std and test/csync.
We also replace Doxygen documentation referring to "NULL" to
"\c nullptr" (formatted as code).
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-08 20:07:50 +02:00
Camila San
3bae570f29
Do not declare local variables without an initial value.
...
Signed-off-by: Camila San <hello@camila.codes>
2020-06-03 07:50:40 +00:00
Christian Kamm
4bd2545dad
Windows: Release handle/fd when file open fails #6699
2018-09-10 21:17:20 +02:00
Roeland Jago Douma
86741de622
Merge pull request #299 from nextcloud/upstream/pr/6349
...
Don't delete contents behind directory junctions #6322
2018-05-30 08:03:04 +02:00
Olivier Goffart
88347a985f
Adjust the Move To Trash patch
...
(PR #6265 )
- Remove the UI completely
- Move the #ifdef inside the FileSystem::moveToTrash function, so it is easier to
implement on other platforms
- Q_OS_UNIX includes mac, so we need to disable it. (not using Q_OS_LINUX because of
other BSD that uses XDG spec as well
- Translate the error messages
- Add a couple of doc comments
2018-05-15 19:10:41 +02:00