Commit Graph

45 Commits

Author SHA1 Message Date
5b6a342a9e
LIB/TESTS: fix moveFileOverwrite and add tests
We must not allow to move a file to a directory, deleting that
directory and effectively changing the filetype.
2016-05-08 23:20:00 +02:00
3af8b36940
GTK: adjust to new LIB API and refactor file error handling
This restructures large parts of the GUI-wise error handling code
and makes it more fine-grained, so the user can react appropriately
to exceptions.
2016-05-08 20:14:30 +02:00
9c6cf51825
LIB: refactor FileOperation and related Errors
* move FileOperation/Copy/Move types to its own UtilTypes module
* remove runFileOp, since it's hard to really do the correct
  thing here for all possible exceptions... instead, let the
  GUI logic handle this
* introduce copyDirRecursiveOverwrite, copyFileOverwrite and
  easyCopyOverwrite
* use our own throwSameFile on functions to distinguish between
  "same file" and "file already exists"
* don't follow destination in copyFile* either
* improve throwSameFile, by examining device and file ids
* add isWritable
* improve documentation
* adjust and fix tests
2016-05-08 18:48:17 +02:00
d58fd6e6f0
LIB: add copyFileOverwrite 2016-05-08 12:48:03 +02:00
8b0e59faa7
LIB: improve documentation 2016-05-03 11:55:34 +02:00
6ec455b515
LIB: make deleteDirRecursive more robust
We now try 'deleteDir' first and only start recursive removal
if that fails.
2016-05-03 11:54:25 +02:00
c84512e3b3
TESTS: add deleteFileSpec 2016-05-02 23:10:22 +02:00
9a11e35be0
TESTS: add getDirsFilesSpec 2016-05-02 22:52:10 +02:00
7e8d465d81
LIB: improve documentation 2016-05-02 22:19:19 +02:00
5670b160d8
TESTS: add getFileTypeSpec 2016-05-02 22:13:19 +02:00
ac41b053e3
LIB: fix legacy comment 2016-05-02 20:51:59 +02:00
37516306d3
LIB: improve documentation formatting 2016-05-02 20:49:08 +02:00
71cee4019b
LIB: fix grammar 2016-05-02 20:38:59 +02:00
782abe2584
LIB: improve documentation 2016-05-02 20:36:22 +02:00
b3b239d4c9
LIB: rm redundant imports 2016-05-02 19:14:52 +02:00
47cd43dba6
LIB: refactor large parts of the API
This makes the FileOperations module more low-level, since we now
handle everything via 'Path Abs' and only leave 'File a' for
e.g. GUI purposes.

Also fixes various bugs in the Errors module.

This depends on custom changes in posix-paths.
2016-05-02 19:06:53 +02:00
e2c83b3c31
LIB/GTK: remove obsolete fullPath/fullPathS and refactor for prettiness 2016-04-16 21:50:15 +02:00
0fca64594d
LIB/GTK: use more recent library versions 2016-04-16 19:14:08 +02:00
bb6c1b3cda
LIB/GTK: refactor File base type
We have now ditched AnchoredFile and just use File with Path Abs
in the path field.

This is useful since we now:
* don't allow "." or ".." as filenames anymore
* normalise paths in our path parsers and reject paths with ".."

This also allows us to know that filepaths are always valid. In addition
the 'basename' function from hpath may throw an exception if run
on the root dir "/". This exception is basically uncatched currently,
which is fine, because it's not a selectable directory.
2016-04-15 14:23:41 +02:00
c2f3da6180
LIB/GTK: improve exceptions/error handling 2016-04-11 01:59:18 +02:00
3f303b4cd4
LIB: minor cleanup 2016-04-10 22:04:07 +02:00
bddf29671a
LIB: improve documentation 2016-04-10 19:25:22 +02:00
59d4051d84
LIB: small cleanup, rm obsolete functions, fix some TODOs 2016-04-10 19:16:06 +02:00
fb8d1d2e3a
LIB: give the buffer size in fallbackCopy a name 2016-04-10 18:58:06 +02:00
48edf7d47b
LIB: make interaction with FileOperation more safe
We now don't safe an AnchoredFile anymore, but a Path and
construct the AnchoredFile just before the operation is carried out.

This means the copy and move buffers cannot contain stale references
to files that don't exist anymore.
2016-04-10 18:52:51 +02:00
bd022956f5
LIB: improve unsafeCopyFile doc 2016-04-10 04:09:29 +02:00
5bcbbcc69c
LIB: overhaul file operations and improve overall performance
This introduces a lot of changes and uses a more solid
file copy operation.
2016-04-10 03:58:20 +02:00
44a90574e8
LIB/GTK: add convenient renaming capabilities on file copy/move 2016-04-09 17:25:14 +02:00
478ffa0e98
LIB/GTK: implement copy/move/delete for multiple files 2016-04-09 15:15:58 +02:00
038b0d0377
LIB: various cleanups 2016-04-06 03:10:07 +02:00
bad817d32d
LIB/GTK: use ByteString instead of String for 2016-04-05 00:56:36 +02:00
695f921c2e
LIB: rm obsolete overwriteFile 2016-04-03 22:54:17 +02:00
0d92ebb8c8
LIB: add destination dir name argument to copyDir 2016-04-03 22:52:18 +02:00
0a71c3c044
LIB: refactor copyFile 2016-04-03 22:36:29 +02:00
fa7cab69c6
LIB: fix copyFile'
Previously, BS.writeFile would fail if the created file
was not writable, obviously. Now we use the file-descriptor
to write the content.
2016-04-03 18:19:02 +02:00
2609338f6e
LIB: fix throwSameFile in copyDir 2016-04-03 17:13:45 +02:00
2777d2d2e8
LIB: fix bug in copyDir 2016-04-03 14:37:01 +02:00
9b03b36f2f
LIB: add throwCantOpenDirectory calls to file operations 2016-04-03 14:36:56 +02:00
0781fc690d
LIB/GTK: improve documentation 2016-04-03 03:57:35 +02:00
4e75a84439
LIB: remove more occurences of FilePath 2016-04-03 03:57:11 +02:00
4da3c92e5e
LIB/GTK: cleanup compiler warnings 2016-03-31 16:19:31 +02:00
65595fa9c5
LIB/GTK: refactor HSFM.FileSystem.Error to use Path type 2016-03-31 15:49:35 +02:00
dd013b7d7b
Fix Copyright 2016-03-31 00:28:23 +02:00
5e232e3d4a
LIB/GTK: use fullPathS 2016-03-31 00:25:03 +02:00
74a48b2668
Restructure module layout 2016-03-30 20:16:34 +02:00