author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 30 Jan 2013 11:15:09 +0000 | |
branch | jv |
changeset 12401 | 4714b9640528 |
parent 12205 | f210b6224ef0 |
parent 11444 | db1f2390855a |
child 12431 | 9f0c59c742d5 |
permissions | -rw-r--r-- |
6168 | 1 |
" |
2 |
COPYRIGHT (c) 2003 by eXept Software AG |
|
7637 | 3 |
All Rights Reserved |
6168 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
6618 | 12 |
"{ Package: 'stx:libtool' }" |
3841 | 13 |
|
14 |
Object subclass:#FileOperation |
|
11444 | 15 |
instanceVariableNames:'errorString result actionForAll' |
3975
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
16 |
classVariableNames:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
17 |
poolDictionaries:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
18 |
category:'Interface-Support' |
3841 | 19 |
! |
20 |
||
3842 | 21 |
FileOperation subclass:#Copy |
6374 | 22 |
instanceVariableNames:'copiedFiles newFiles' |
3975
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
23 |
classVariableNames:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
24 |
poolDictionaries:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
25 |
privateIn:FileOperation |
3842 | 26 |
! |
27 |
||
7634 | 28 |
FileOperation::Copy subclass:#CopyCorrupted |
7637 | 29 |
instanceVariableNames:'' |
7634 | 30 |
classVariableNames:'' |
31 |
poolDictionaries:'' |
|
32 |
privateIn:FileOperation |
|
33 |
! |
|
34 |
||
3842 | 35 |
FileOperation subclass:#Create |
3975
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
36 |
instanceVariableNames:'createdFile' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
37 |
classVariableNames:'LastCreatedDirectory LastCreatedFile' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
38 |
poolDictionaries:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
39 |
privateIn:FileOperation |
3842 | 40 |
! |
41 |
||
42 |
FileOperation subclass:#Delete |
|
3975
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
43 |
instanceVariableNames:'fileName' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
44 |
classVariableNames:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
45 |
poolDictionaries:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
46 |
privateIn:FileOperation |
3842 | 47 |
! |
48 |
||
6168 | 49 |
FileOperation::Delete subclass:#Erase |
50 |
instanceVariableNames:'' |
|
51 |
classVariableNames:'' |
|
52 |
poolDictionaries:'' |
|
53 |
privateIn:FileOperation |
|
54 |
! |
|
55 |
||
3842 | 56 |
FileOperation subclass:#Move |
6374 | 57 |
instanceVariableNames:'movedFiles' |
3975
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
58 |
classVariableNames:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
59 |
poolDictionaries:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
60 |
privateIn:FileOperation |
3842 | 61 |
! |
62 |
||
63 |
FileOperation subclass:#Rename |
|
3975
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
64 |
instanceVariableNames:'renamedFiles' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
65 |
classVariableNames:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
66 |
poolDictionaries:'' |
dcaac82381dc
share goodRenameDefault code with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
3877
diff
changeset
|
67 |
privateIn:FileOperation |
3842 | 68 |
! |
69 |
||
6168 | 70 |
!FileOperation class methodsFor:'documentation'! |
71 |
||
72 |
copyright |
|
73 |
" |
|
74 |
COPYRIGHT (c) 2003 by eXept Software AG |
|
7637 | 75 |
All Rights Reserved |
6168 | 76 |
|
77 |
This software is furnished under a license and may be used |
|
78 |
only in accordance with the terms of that license and with the |
|
79 |
inclusion of the above copyright notice. This software may not |
|
80 |
be provided or otherwise made available to, or used by, any |
|
81 |
other person. No title to or ownership of the software is |
|
82 |
hereby transferred. |
|
83 |
" |
|
84 |
! ! |
|
3841 | 85 |
|
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
86 |
|
7634 | 87 |
!FileOperation class methodsFor:'instance creation'! |
88 |
||
89 |
copyCorruptedFile:aSourceFile to:aDestFile |
|
7637 | 90 |
^ CopyCorrupted |
91 |
copyFile:aSourceFile to:aDestFile |
|
7634 | 92 |
|
93 |
"Created: / 07-02-2007 / 18:41:24 / cg" |
|
94 |
! |
|
5961 | 95 |
|
96 |
copyFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarningBoolean copyFileIfSame:copyIfSameBoolean |
|
7637 | 97 |
^ Copy |
98 |
copyFile:aSourceFile to:aDestFile |
|
99 |
withOverWriteWarning:overWriteWarningBoolean |
|
100 |
copyFileIfSame:copyIfSameBoolean |
|
5961 | 101 |
! |
102 |
||
103 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
104 |
^ Copy copyFiles:aColOfSourceFiles to:aDirectory |
|
105 |
! |
|
106 |
||
107 |
createDirectoryIn:aDirectory |
|
108 |
^ Create createDirectoryIn:aDirectory |
|
109 |
! |
|
110 |
||
111 |
createDirectoryIn:aDirectory initialAnswer:defaultAnswer |
|
112 |
^ Create createDirectoryIn:aDirectory initialAnswer:defaultAnswer |
|
113 |
! |
|
114 |
||
115 |
createFileIn:aDirectory |
|
116 |
^ Create createFileIn:aDirectory |
|
117 |
! |
|
118 |
||
119 |
createHardLinkIn:dir |
|
120 |
^ Create createHardLinkIn:dir |
|
121 |
! |
|
122 |
||
6151 | 123 |
createLinkIn:dir soft:soft |
124 |
^ Create createLinkIn:dir soft:soft |
|
125 |
! |
|
126 |
||
5961 | 127 |
createSoftLinkIn:dir |
128 |
^ Create createSoftLinkIn:dir |
|
129 |
! |
|
130 |
||
131 |
deleteFiles:colOfFiles confirm:confirm |
|
132 |
^ Delete deleteFiles:colOfFiles confirm:confirm |
|
133 |
! |
|
134 |
||
6168 | 135 |
eraseFiles:colOfFiles confirm:confirm |
136 |
^ Erase deleteFiles:colOfFiles confirm:confirm |
|
137 |
! |
|
138 |
||
5961 | 139 |
moveFile:aSourceFile to:aDestFile |
6168 | 140 |
^ Move moveFile:aSourceFile to:aDestFile |
5961 | 141 |
! |
142 |
||
143 |
moveFiles:aCollectionOfFiles to:aDestDirectory |
|
6168 | 144 |
^ Move moveFiles:aCollectionOfFiles to:aDestDirectory |
5961 | 145 |
! |
146 |
||
147 |
renameFile:filename to:newFileString |
|
6168 | 148 |
^ Rename renameFile:filename to:newFileString |
5961 | 149 |
! |
150 |
||
151 |
renameFiles:aCollectionofFilenames |
|
6168 | 152 |
^ Rename renameFiles:aCollectionofFilenames |
5961 | 153 |
! ! |
154 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
155 |
|
3841 | 156 |
!FileOperation class methodsFor:'defaults'! |
157 |
||
6168 | 158 |
suffixForCopyOverExistingFile |
3841 | 159 |
^ '.copy' |
160 |
! ! |
|
161 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
162 |
|
3841 | 163 |
!FileOperation methodsFor:'accessing'! |
164 |
||
165 |
errorString |
|
166 |
^ errorString |
|
167 |
! |
|
168 |
||
169 |
errorString:something |
|
170 |
errorString := something. |
|
171 |
! |
|
172 |
||
173 |
result |
|
174 |
^ result |
|
175 |
! |
|
176 |
||
177 |
result:something |
|
178 |
result := something. |
|
179 |
! ! |
|
180 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
181 |
|
7634 | 182 |
!FileOperation methodsFor:'dialogs & helpers'! |
183 |
||
184 |
checkDirectoryExists:aDirectory |
|
185 |
aDirectory exists ifFalse:[ |
|
9663
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
186 |
(Dialog confirm:(FileBrowser classResources |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
187 |
stringWithCRs:'Non-existing directory: %1\\Create?' |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
188 |
with:aDirectory asString) |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
189 |
) ifFalse:[ |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
190 |
^ false |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
191 |
]. |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
192 |
aDirectory recursiveMakeDirectory. |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
193 |
aDirectory exists ifFalse:[ |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
194 |
Dialog warn:(FileBrowser classResources |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
195 |
string:'Failed to create directory: %1'). |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
196 |
^ false |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
197 |
]. |
7634 | 198 |
]. |
199 |
aDirectory isDirectory ifFalse:[ |
|
9663
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
200 |
Dialog warn:('Not a directory: %1' bindWith:aDirectory asString). |
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
201 |
^ false |
7634 | 202 |
]. |
203 |
^ true |
|
204 |
||
205 |
"Created: / 07-02-2007 / 18:30:49 / cg" |
|
9663
7837d4646761
changed: #checkDirectoryExists:
Claus Gittinger <cg@exept.de>
parents:
9650
diff
changeset
|
206 |
"Modified: / 09-12-2010 / 08:45:45 / cg" |
7634 | 207 |
! |
3841 | 208 |
|
6168 | 209 |
fileExistsDialogForNewFile:newFile oldFile:oldFile withCancel:withCancel |
4701 | 210 |
"return true, if the file should be moved/copied. |
211 |
Ask user if oldFile exists." |
|
212 |
||
6168 | 213 |
^ self fileExistsDialogForNewFile:newFile oldFile:oldFile withCancel:withCancel withRemoveIfSame:false. |
5862 | 214 |
! |
215 |
||
6168 | 216 |
fileExistsDialogForNewFile:newFile oldFile:oldFile withCancel:withCancel withRemoveIfSame:withRemoveIfSame |
5862 | 217 |
"return true, if the file should be moved/copied. |
218 |
If oldFile exists, ask user. |
|
219 |
If withRemoveIfSame is true, two additional possible values are returned: |
|
8557 | 220 |
#removeSource and #removeDestination. |
5862 | 221 |
" |
222 |
||
11444 | 223 |
^ self |
224 |
fileExistsDialogForNewFile:newFile oldFile:oldFile withCancel:withCancel withRemoveIfSame:withRemoveIfSame |
|
225 |
withAllAction:false |
|
226 |
||
227 |
"Modified: / 20-03-2012 / 11:44:51 / cg" |
|
228 |
! |
|
229 |
||
230 |
fileExistsDialogForNewFile:newFile oldFile:oldFile withCancel:withCancel withRemoveIfSame:withRemoveIfSame withAllAction:withAllAction |
|
231 |
"return true, if the file should be moved/copied. |
|
232 |
If oldFile exists, ask user. |
|
233 |
If withRemoveIfSame is true, two additional possible values are returned: |
|
234 |
#removeSource and #removeDestination. |
|
235 |
" |
|
236 |
||
237 |
|msg oldSize newSize sameContents resources sourceType destType labels values default olderOrNewer |
|
238 |
forAllHolder answer| |
|
4701 | 239 |
|
240 |
newFile exists ifFalse:[ ^ true ]. |
|
241 |
oldSize := oldFile fileSize. |
|
242 |
newSize := newFile fileSize. |
|
243 |
||
5888 | 244 |
sameContents := false. |
245 |
||
246 |
newFile isDirectory ifTrue:[ |
|
8557 | 247 |
oldFile isDirectory ifTrue:[ |
248 |
"/ could (should?) recursively look for same contents here... |
|
249 |
]. |
|
5888 | 250 |
] ifFalse:[ |
8557 | 251 |
oldFile isDirectory ifFalse:[ |
252 |
sameContents := oldSize = newSize and:[oldFile sameContentsAs:newFile]. |
|
253 |
] |
|
5888 | 254 |
]. |
255 |
||
8557 | 256 |
resources := AbstractFileBrowser classResources. |
257 |
||
5888 | 258 |
"/ for now: |
259 |
oldFile isDirectory ~~ newFile isDirectory ifTrue:[ |
|
8557 | 260 |
Dialog warn:(resources string:'Will not overwrite directory with file and vice versa.'). |
261 |
^ false. |
|
5888 | 262 |
]. |
263 |
||
264 |
sourceType := newFile isDirectory ifTrue:'directory' ifFalse:'file'. |
|
265 |
destType := oldFile isDirectory ifTrue:'directory' ifFalse:'file'. |
|
3841 | 266 |
|
4701 | 267 |
sameContents ifTrue:[ |
9512
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
268 |
msg := 'Overwrite existing destination %7:\\ %1\ size: %3 of %2\\with %8 source (same contents):\\ %4\ size: %6 of %5'. |
4701 | 269 |
] ifFalse:[ |
9512
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
270 |
msg := 'Overwrite existing destination %7:\\ %1\ size: %3 of %2\\with %8 source:\\ %4\ size: %6 of %5'. |
4701 | 271 |
]. |
4587 | 272 |
|
9512
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
273 |
olderOrNewer := newFile modificationTime < oldFile modificationTime |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
274 |
ifTrue:[ 'newer' ] |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
275 |
ifFalse:[ 'older' ]. |
7637 | 276 |
msg := resources |
8557 | 277 |
stringWithCRs:msg |
278 |
withArgs:(Array |
|
279 |
with:newFile asString allBold |
|
280 |
with:(newFile modificationTime printStringFormat:'%(Day)-%(mon)-%(year) %h:%m:%s') |
|
281 |
with:newSize |
|
282 |
with:oldFile asString allBold |
|
283 |
with:(oldFile modificationTime printStringFormat:'%(Day)-%(mon)-%(year) %h:%m:%s') |
|
284 |
with:oldSize |
|
9512
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
285 |
with:destType |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
286 |
with:(resources string:olderOrNewer) ). |
4701 | 287 |
|
5862 | 288 |
(sameContents and:[withRemoveIfSame]) ifTrue:[ |
9512
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
289 |
labels := #( 'No' 'Remove Destination' 'Remove Source' 'Yes'). |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
290 |
values := #( false #removeDestination #removeSource true ). |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
291 |
withCancel ifTrue:[ |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
292 |
labels := #('Cancel') , labels. |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
293 |
values := #( nil ) , values. |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
294 |
]. |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
295 |
default := #removeSource. |
5862 | 296 |
] ifFalse:[ |
9512
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
297 |
labels := #( 'No' 'Yes'). |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
298 |
values := #( false true ). |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
299 |
withCancel ifTrue:[ |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
300 |
labels := #('Cancel') , labels. |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
301 |
values := #( nil ) , values. |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
302 |
]. |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
303 |
default := false. |
5862 | 304 |
]. |
9512
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
305 |
|
11444 | 306 |
forAllHolder := false asValue. |
307 |
Dialog aboutToOpenBoxNotificationSignal handle:[:ex | |
|
308 |
withAllAction ifTrue:[ |
|
309 |
ex box addVerticalSpace:10. |
|
310 |
ex box verticalPanel |
|
311 |
add:(CheckBox |
|
312 |
label:'Same action for all' |
|
313 |
model:forAllHolder). |
|
314 |
]. |
|
315 |
ex proceed |
|
316 |
] do:[ |
|
317 |
answer := OptionBox |
|
9512
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
318 |
request:msg |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
319 |
label:(resources string:'Overwrite existing file') |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
320 |
image:(YesNoBox iconBitmap) |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
321 |
buttonLabels:(resources array:labels) |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
322 |
values:values |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
323 |
default:default |
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
324 |
onCancel:nil. |
11444 | 325 |
]. |
326 |
(withAllAction and:[answer notNil]) ifTrue:[ |
|
327 |
actionForAll := answer |
|
328 |
]. |
|
329 |
^ answer |
|
9512
fc8df478d3f1
changed: #fileExistsDialogForNewFile:oldFile:withCancel:withRemoveIfSame:
Claus Gittinger <cg@exept.de>
parents:
9501
diff
changeset
|
330 |
|
11444 | 331 |
"Created: / 20-03-2012 / 11:44:34 / cg" |
3841 | 332 |
! ! |
333 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
334 |
|
6285 | 335 |
!FileOperation methodsFor:'queries'! |
336 |
||
337 |
isErase |
|
338 |
^ false |
|
339 |
! ! |
|
340 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
341 |
|
3842 | 342 |
!FileOperation::Copy class methodsFor:'actions'! |
343 |
||
344 |
copyFile:aSourceFile to:aDestFile |
|
345 |
|instance| |
|
346 |
||
347 |
instance := self new. |
|
348 |
instance copyFile:aSourceFile to:aDestFile. |
|
349 |
^ instance |
|
350 |
! |
|
351 |
||
352 |
copyFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarning |
|
353 |
|instance| |
|
354 |
||
355 |
instance := self new. |
|
356 |
instance copyFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarning. |
|
357 |
^ instance |
|
358 |
! |
|
359 |
||
5961 | 360 |
copyFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarningBoolean copyFileIfSame:copyIfSameBoolean |
3842 | 361 |
|instance| |
362 |
||
363 |
instance := self new. |
|
5961 | 364 |
instance copyFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarningBoolean copyFileIfSame:copyIfSameBoolean. |
3842 | 365 |
^ instance |
366 |
! |
|
367 |
||
368 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
369 |
|instance| |
|
370 |
||
371 |
instance := self new. |
|
372 |
instance copyFiles:aColOfSourceFiles to:aDirectory. |
|
373 |
^ instance |
|
374 |
! |
|
375 |
||
376 |
copyFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning |
|
377 |
|instance| |
|
378 |
||
379 |
instance := self new. |
|
380 |
instance copyFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning. |
|
381 |
^ instance |
|
382 |
! |
|
383 |
||
384 |
copyFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning copyFileIfSame:copy |
|
385 |
|instance| |
|
386 |
||
387 |
instance := self new. |
|
388 |
instance copyFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning copyFileIfSame:copy. |
|
389 |
^ instance |
|
390 |
! ! |
|
391 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
392 |
|
3842 | 393 |
!FileOperation::Copy methodsFor:'accessing'! |
394 |
||
395 |
colOfCopiedFiles |
|
6373 | 396 |
"obsolete - bad name" |
397 |
||
398 |
^ self collectionOfCopiedFiles |
|
399 |
! |
|
400 |
||
401 |
collectionOfCopiedFiles |
|
6374 | 402 |
copiedFiles isNil ifTrue:[ |
7637 | 403 |
copiedFiles := OrderedCollection new. |
3842 | 404 |
]. |
6374 | 405 |
^ copiedFiles |
406 |
! |
|
407 |
||
408 |
collectionOfNewFiles |
|
409 |
newFiles isNil ifTrue:[ |
|
7637 | 410 |
newFiles := OrderedCollection new. |
6374 | 411 |
]. |
412 |
^ newFiles |
|
3842 | 413 |
! ! |
414 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
415 |
|
3842 | 416 |
!FileOperation::Copy methodsFor:'actions'! |
417 |
||
418 |
copyFile:aSourceFile to:aDestFile |
|
419 |
self copyFile:aSourceFile to:aDestFile withOverWriteWarning:true |
|
420 |
! |
|
421 |
||
422 |
copyFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarning |
|
423 |
self copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true |
|
424 |
! |
|
425 |
||
6373 | 426 |
copyFiles:aColOfSourceFiles to:aDirectory |
7637 | 427 |
^ self copyFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:true. |
6373 | 428 |
! |
429 |
||
7637 | 430 |
copyFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning |
6373 | 431 |
^ self copyFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning copyFileIfSame:true. |
432 |
! ! |
|
433 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
434 |
|
6373 | 435 |
!FileOperation::Copy methodsFor:'actions-basic'! |
436 |
||
7634 | 437 |
basicCopy:aSourceFile to:newFile |
438 |
aSourceFile isDirectory ifTrue:[ |
|
8289
8dcce3984b27
fixed recursive directory copy
Claus Gittinger <cg@exept.de>
parents:
7637
diff
changeset
|
439 |
aSourceFile recursiveCopyTo:newFile. |
8dcce3984b27
fixed recursive directory copy
Claus Gittinger <cg@exept.de>
parents:
7637
diff
changeset
|
440 |
"/ OperatingSystem recursiveCopyDirectory:(aSourceFile pathName) to:(newFile pathName). |
7634 | 441 |
] ifFalse:[ |
8289
8dcce3984b27
fixed recursive directory copy
Claus Gittinger <cg@exept.de>
parents:
7637
diff
changeset
|
442 |
aSourceFile copyTo:newFile. |
7634 | 443 |
]. |
3842 | 444 |
|
7634 | 445 |
"Created: / 07-02-2007 / 18:35:52 / cg" |
446 |
! |
|
447 |
||
448 |
copyFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarningBoolean copyFileIfSame:copyIfSameBoolean |
|
449 |
|newFile fileString targetDirectory suffix| |
|
450 |
||
451 |
aDestFile isDirectory ifTrue:[ |
|
7637 | 452 |
targetDirectory := aDestFile. |
453 |
newFile := aDestFile construct:(aSourceFile baseName). |
|
3842 | 454 |
] ifFalse:[ |
7637 | 455 |
targetDirectory := aDestFile directory. |
456 |
newFile := aDestFile. |
|
3842 | 457 |
]. |
7634 | 458 |
|
3842 | 459 |
"/ do not copy if destination directory doest exist. |
7634 | 460 |
(self checkDirectoryExists:targetDirectory) ifFalse:[ |
7637 | 461 |
result := false. |
462 |
^ self |
|
3842 | 463 |
]. |
464 |
(newFile exists) ifTrue:[ |
|
7637 | 465 |
((newFile asString = aSourceFile asString) and:[copyIfSameBoolean]) ifTrue:[ |
466 |
[newFile exists] whileTrue:[ |
|
467 |
suffix := newFile suffix. |
|
468 |
fileString := newFile baseName withoutSuffix, self class suffixForCopyOverExistingFile, '.', suffix. |
|
469 |
newFile := targetDirectory construct:fileString. |
|
470 |
]. |
|
471 |
] ifFalse:[ |
|
472 |
overWriteWarningBoolean ifTrue:[ |
|
473 |
(self fileExistsDialogForNewFile:newFile oldFile:aSourceFile withCancel:false withRemoveIfSame:false) ifFalse:[ |
|
474 |
result := false. |
|
475 |
^ self. |
|
476 |
] |
|
477 |
] ifFalse:[ |
|
478 |
result := false. |
|
479 |
^ self. |
|
480 |
] |
|
481 |
]. |
|
3842 | 482 |
]. |
483 |
Error handle:[:ex| |
|
7637 | 484 |
"was not able to copy it" |
485 |
WarningBox warn:'on copy file - ', ex errorString. |
|
486 |
self errorString:('on copy file - ', ex description asString). |
|
487 |
result := false. |
|
488 |
^ self |
|
3842 | 489 |
] do:[ |
7637 | 490 |
self basicCopy:aSourceFile to:newFile. |
3842 | 491 |
]. |
4006
8c706ba8b3b5
change flushCachedDirectory: senders to flushCachedDirectoryFor:
penk
parents:
3977
diff
changeset
|
492 |
DirectoryContents flushCachedDirectoryFor:(aSourceFile directory). |
8c706ba8b3b5
change flushCachedDirectory: senders to flushCachedDirectoryFor:
penk
parents:
3977
diff
changeset
|
493 |
result := true. |
7634 | 494 |
|
495 |
"Modified: / 07-02-2007 / 18:36:02 / cg" |
|
3842 | 496 |
! |
497 |
||
498 |
copyFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning copyFileIfSame:copy |
|
7634 | 499 |
|newFile suffix fileString doCopy| |
3842 | 500 |
|
7634 | 501 |
"/ do not copy if destination directory doest exist. |
502 |
(self checkDirectoryExists:aDirectory) ifFalse:[ |
|
7637 | 503 |
result := false. |
504 |
^ self |
|
3842 | 505 |
]. |
6374 | 506 |
|
507 |
aColOfSourceFiles do:[:filename | |
|
7637 | 508 |
newFile := aDirectory construct:(filename baseName). |
509 |
doCopy := true. |
|
510 |
(newFile exists) ifTrue:[ |
|
511 |
((newFile asString = filename asString) and:[copy]) ifTrue:[ |
|
512 |
[newFile exists] whileTrue:[ |
|
513 |
suffix := newFile suffix. |
|
514 |
fileString := newFile withoutSuffix baseName, self class suffixForCopyOverExistingFile. |
|
515 |
suffix notEmpty ifTrue:[ |
|
516 |
fileString := fileString, '.', suffix. |
|
517 |
]. |
|
518 |
newFile := aDirectory construct:fileString. |
|
519 |
]. |
|
520 |
] ifFalse:[ |
|
521 |
overWriteWarning ifTrue:[ |
|
522 |
doCopy := (self fileExistsDialogForNewFile:newFile oldFile:filename withCancel:(aColOfSourceFiles size > 1) withRemoveIfSame:false). |
|
523 |
doCopy isNil ifTrue:[ |
|
524 |
" abort pressed " |
|
525 |
result := false. |
|
526 |
^ self. |
|
527 |
] |
|
528 |
] |
|
529 |
]. |
|
530 |
]. |
|
531 |
doCopy ifTrue:[ |
|
532 |
Error handle:[:ex| |
|
533 |
|msg| |
|
7634 | 534 |
|
7637 | 535 |
msg := 'on copy file - ', ex description asString. |
536 |
"was not able to copy it" |
|
537 |
result := false. |
|
538 |
self errorString:msg. |
|
539 |
( Dialog |
|
540 |
confirm:('Error ',msg) |
|
541 |
title:'Copy' |
|
542 |
yesLabel:'Continue' |
|
543 |
noLabel:'Abort') ifTrue:[ |
|
544 |
ex proceed. |
|
545 |
] ifFalse:[ |
|
546 |
^ self. |
|
547 |
]. |
|
548 |
] do:[ |
|
549 |
self basicCopy:filename to:newFile |
|
550 |
]. |
|
551 |
self collectionOfCopiedFiles add:filename. |
|
552 |
self collectionOfNewFiles add:newFile. |
|
553 |
] |
|
3842 | 554 |
]. |
4006
8c706ba8b3b5
change flushCachedDirectory: senders to flushCachedDirectoryFor:
penk
parents:
3977
diff
changeset
|
555 |
DirectoryContents flushCachedDirectoryFor:aDirectory. |
3842 | 556 |
result := true. |
7634 | 557 |
|
558 |
"Modified: / 07-02-2007 / 18:36:54 / cg" |
|
559 |
! ! |
|
560 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
561 |
|
7634 | 562 |
!FileOperation::CopyCorrupted methodsFor:'actions-basic'! |
563 |
||
564 |
basicCopy:aSourceFile to:newFile |
|
565 |
aSourceFile isDirectory ifTrue:[ |
|
7637 | 566 |
newFile makeDirectory. |
567 |
aSourceFile directoryContentsDo:[:eachFileOrDirectory | |
|
568 |
self basicCopy:(aSourceFile construct:eachFileOrDirectory) to:(newFile construct:eachFileOrDirectory) |
|
569 |
]. |
|
7634 | 570 |
] ifFalse:[ |
7637 | 571 |
self basicCopyFile:aSourceFile to:newFile. |
7634 | 572 |
]. |
573 |
||
574 |
"Created: / 07-02-2007 / 18:39:03 / cg" |
|
575 |
! |
|
576 |
||
577 |
basicCopyFile:sourceFile to:destFile |
|
578 |
"this is a copy which is tolerant w.r.t. read errors. |
|
579 |
Wheneven a read fails, a number of retries is performed |
|
580 |
(with smaller buffer sizes) and, a block of zeros is eventually written. |
|
581 |
This allows for partially corrupted data to be read from a tape or disk." |
|
582 |
||
583 |
|in in2 out doWrite doRead fileSize offset buffer bufferSize nRead nWritten nSingle |
|
584 |
lostStart lostEnd seekFailed| |
|
585 |
||
9501 | 586 |
buffer := ByteArray new:(self bufferSize). |
7634 | 587 |
bufferSize := buffer size. |
588 |
offset := 0. |
|
589 |
fileSize := sourceFile fileSize. |
|
590 |
in := sourceFile readStream binary. |
|
591 |
out := destFile writeStream binary. |
|
592 |
||
593 |
doWrite := [:n | |
|
8557 | 594 |
nWritten := out nextPutBytes:n from:buffer startingAt:1. |
595 |
offset := offset + nWritten. |
|
596 |
nWritten ~= n ifTrue:[ |
|
597 |
self error:'Write error'. |
|
598 |
]. |
|
599 |
]. |
|
7634 | 600 |
|
601 |
doRead := [:n | |
|
8557 | 602 |
ReadError handle:[:ex | |
603 |
nRead := 0. |
|
604 |
in position:offset. |
|
605 |
] do:[ |
|
606 |
nRead := in nextBytes:n into:buffer startingAt:1. |
|
607 |
]. |
|
608 |
]. |
|
7634 | 609 |
|
610 |
[ |
|
8557 | 611 |
[offset < fileSize] whileTrue:[ |
612 |
doRead value:(bufferSize min:(fileSize - offset)). |
|
613 |
nRead > 0 ifTrue:[ |
|
614 |
lostStart notNil ifTrue:[ |
|
615 |
Transcript showCR:'CORRUPT: ',(lostStart printString),' .. ',(lostEnd printString). |
|
616 |
lostStart := nil. |
|
617 |
]. |
|
618 |
doWrite value:nRead. |
|
619 |
]. |
|
7634 | 620 |
|
8557 | 621 |
nRead == (bufferSize min:(fileSize - offset)) ifTrue:[ |
622 |
bufferSize < buffer size ifTrue:[ |
|
623 |
bufferSize := bufferSize * 2. |
|
624 |
]. |
|
625 |
] ifFalse:[ |
|
626 |
nRead == 0 ifTrue:[ |
|
627 |
"/ try reading single blocks for a while... |
|
9501 | 628 |
nSingle := self defectBlockRetryCount. |
8557 | 629 |
[ |
9501 | 630 |
nSingle > 0 |
8557 | 631 |
and:[ |
9501 | 632 |
doRead value:(self defectBlockCopySize). |
8557 | 633 |
nRead > 0] |
634 |
] whileTrue:[ |
|
635 |
lostStart notNil ifTrue:[ |
|
636 |
Transcript showCR:'CORRUPT: ',(lostStart printString),' .. ',(lostEnd printString). |
|
637 |
lostStart := nil. |
|
638 |
]. |
|
9501 | 639 |
Transcript showCR:'single block at ',offset printString, 'size=',nRead printString. |
8557 | 640 |
doWrite value:nRead. |
641 |
nSingle := nSingle - 1. |
|
642 |
]. |
|
7634 | 643 |
|
8557 | 644 |
nRead == 0 ifTrue:[ |
645 |
in2 := sourceFile readStream binary. |
|
646 |
Error handle:[:ex | |
|
647 |
] do:[ |
|
648 |
in2 position:0. |
|
649 |
in2 nextBytes:buffer size into:buffer startingAt:1. |
|
650 |
]. |
|
651 |
seekFailed := false. |
|
652 |
Error handle:[:ex | |
|
653 |
seekFailed := true. |
|
654 |
] do:[ |
|
655 |
in2 position:offset. |
|
656 |
]. |
|
657 |
seekFailed ifTrue:[ |
|
9501 | 658 |
buffer atAllPut:0. |
8557 | 659 |
Transcript showCR:'bad seek at ',offset printString. |
9501 | 660 |
doWrite value:(self defectBlockCopySize). |
8557 | 661 |
] ifFalse:[ |
662 |
in close. |
|
663 |
in := in2. |
|
9501 | 664 |
doRead value:(self defectBlockCopySize). |
8557 | 665 |
nRead > 0 ifTrue:[ |
7634 | 666 |
Transcript showCR:'single after reopen at ',offset printString. |
8557 | 667 |
doWrite value:nRead. |
668 |
] ifFalse:[ |
|
669 |
lostStart isNil ifTrue:[ |
|
670 |
lostStart := lostEnd := offset. |
|
671 |
] ifFalse:[ |
|
672 |
lostEnd := offset. |
|
673 |
]. |
|
9501 | 674 |
buffer atAllPut:0. |
7634 | 675 |
Transcript showCR:'bad at ',offset printString. |
9501 | 676 |
doWrite value:(self defectBlockCopySize). |
677 |
bufferSize := (self defectBlockCopySize). |
|
8557 | 678 |
]. |
679 |
] |
|
680 |
] |
|
681 |
]. |
|
682 |
]. |
|
683 |
Transcript showCR:offset. |
|
684 |
]. |
|
7634 | 685 |
] ensure:[ |
8557 | 686 |
in close. |
687 |
out close. |
|
7634 | 688 |
]. |
689 |
lostStart notNil ifTrue:[ |
|
8557 | 690 |
Transcript showCR:'CORRUPT: ',(lostStart printString),' .. ',(lostEnd printString). |
691 |
lostStart := nil. |
|
7634 | 692 |
]. |
693 |
||
694 |
"Created: / 07-02-2007 / 18:40:32 / cg" |
|
9501 | 695 |
"Modified: / 21-06-2010 / 14:25:22 / cg" |
696 |
! ! |
|
697 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
698 |
|
9501 | 699 |
!FileOperation::CopyCorrupted methodsFor:'defaults'! |
700 |
||
701 |
bufferSize |
|
702 |
^ 1024*1024*1 |
|
703 |
||
704 |
"Created: / 21-06-2010 / 14:20:35 / cg" |
|
705 |
! |
|
706 |
||
707 |
defectBlockCopySize |
|
708 |
"/ ^ 256 |
|
9650 | 709 |
^ 128*1024 |
9501 | 710 |
|
711 |
"Created: / 21-06-2010 / 14:22:23 / cg" |
|
9650 | 712 |
"Modified: / 27-11-2010 / 18:06:10 / cg" |
9501 | 713 |
! |
714 |
||
715 |
defectBlockRetryCount |
|
9650 | 716 |
^ 1 |
9501 | 717 |
|
718 |
"Created: / 21-06-2010 / 14:24:45 / cg" |
|
9650 | 719 |
"Modified: / 27-11-2010 / 18:05:19 / cg" |
3842 | 720 |
! ! |
721 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
722 |
|
3842 | 723 |
!FileOperation::Create class methodsFor:'actions'! |
724 |
||
3863 | 725 |
createDirectoryIn:aDirectory |
3842 | 726 |
|
727 |
|instance| |
|
728 |
||
729 |
instance := self new. |
|
3863 | 730 |
instance createDirectoryIn:aDirectory. |
3842 | 731 |
^ instance |
732 |
! |
|
733 |
||
5961 | 734 |
createDirectoryIn:aDirectory initialAnswer:defaultAnswer |
735 |
||
736 |
|instance| |
|
737 |
||
738 |
instance := self new. |
|
739 |
instance createDirectoryIn:aDirectory initialAnswer:defaultAnswer. |
|
740 |
^ instance |
|
741 |
! |
|
742 |
||
3863 | 743 |
createFileIn:aFile |
3842 | 744 |
|
745 |
|instance| |
|
746 |
||
747 |
instance := self new. |
|
3863 | 748 |
instance createFileIn:aFile. |
3842 | 749 |
^ instance |
3877 | 750 |
! |
751 |
||
752 |
createHardLinkIn:aFile |
|
753 |
"create an new hard link in a files directory" |
|
754 |
||
6151 | 755 |
^ self createLinkIn:aFile soft:false |
756 |
! |
|
757 |
||
758 |
createLinkIn:aFile soft:soft |
|
759 |
"create an new soft or hard link in a files directory" |
|
760 |
||
3877 | 761 |
|instance| |
762 |
||
763 |
instance := self new. |
|
6151 | 764 |
instance createLinkIn:aFile soft:soft. |
3877 | 765 |
^ instance |
766 |
! |
|
767 |
||
768 |
createSoftLinkIn:aFile |
|
769 |
"create an new soft link in a files directory" |
|
770 |
||
6151 | 771 |
^ self createLinkIn:aFile soft:true |
3842 | 772 |
! ! |
773 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
774 |
|
3863 | 775 |
!FileOperation::Create methodsFor:'accessing'! |
776 |
||
777 |
createdFile |
|
778 |
^ createdFile |
|
779 |
! |
|
780 |
||
781 |
createdFile:something |
|
782 |
createdFile := something. |
|
3842 | 783 |
! ! |
784 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
785 |
|
3842 | 786 |
!FileOperation::Create methodsFor:'actions'! |
787 |
||
3863 | 788 |
createDirectoryIn:startDirectory |
4522 | 789 |
|defaultDirectory| |
3863 | 790 |
|
4522 | 791 |
"/ stupid - that one already exists |
792 |
"/ LastCreatedDirectory notNil ifTrue:[ |
|
793 |
"/ defaultDirectory := LastCreatedDirectory baseName. |
|
794 |
"/ ]. |
|
7637 | 795 |
|
4522 | 796 |
^ self createDirectoryIn:startDirectory initialAnswer:defaultDirectory |
797 |
! |
|
798 |
||
6373 | 799 |
createHardLinkIn:aFile |
800 |
"create an new hard link in a files directory" |
|
801 |
||
802 |
self createLinkIn:aFile soft:false. |
|
803 |
! |
|
804 |
||
805 |
createSoftLinkIn:aFile |
|
806 |
"create an new soft link in a files directory" |
|
807 |
||
808 |
self createLinkIn:aFile soft:true. |
|
809 |
! |
|
810 |
||
811 |
operationError:msg |
|
812 |
self result:false. |
|
813 |
Dialog warn:msg. |
|
814 |
self errorString:msg. |
|
815 |
! ! |
|
816 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
817 |
|
6373 | 818 |
!FileOperation::Create methodsFor:'actions-basic'! |
819 |
||
4522 | 820 |
createDirectoryIn:startDirectory initialAnswer:initialAnswerArg |
4584 | 821 |
|resources initialAnswer msg startBaseName newName newDir| |
822 |
||
823 |
resources := AbstractFileBrowser classResources. |
|
3842 | 824 |
|
3863 | 825 |
startBaseName := startDirectory baseName. |
4522 | 826 |
initialAnswer := initialAnswerArg. |
827 |
(startDirectory construct:initialAnswer) exists ifTrue:[ |
|
7637 | 828 |
initialAnswer := nil. |
3863 | 829 |
]. |
7084 | 830 |
newName := Dialog |
7637 | 831 |
request:(resources string:'Create New Directory in %1:' with:startBaseName allBold) |
832 |
initialAnswer:initialAnswer |
|
833 |
okLabel:(resources string:'Create') |
|
834 |
title:(resources string:'Create Directory') |
|
835 |
onCancel:[ |
|
836 |
self result:false. |
|
837 |
^ self |
|
838 |
]. |
|
3863 | 839 |
newName isEmpty ifTrue:[ |
7637 | 840 |
self result:false. |
841 |
^ self |
|
3863 | 842 |
]. |
4522 | 843 |
newDir := startDirectory construct:newName. |
844 |
newDir exists ifTrue:[ |
|
7637 | 845 |
Dialog warn:(newName, ' already exists.'). |
846 |
result := false. |
|
847 |
^ self |
|
3842 | 848 |
]. |
849 |
||
4522 | 850 |
newDir makeDirectory ifFalse:[ |
7637 | 851 |
msg := errorString := ('cannot create directory '', newName,'' !!') , '(', (OperatingSystem lastErrorString) , ')'. |
852 |
errorString := msg. |
|
853 |
Dialog warn:errorString. |
|
854 |
result := false. |
|
855 |
^ self |
|
3842 | 856 |
]. |
4522 | 857 |
self createdFile:newDir. |
858 |
LastCreatedDirectory := newDir. |
|
3842 | 859 |
result := true. |
7084 | 860 |
|
861 |
"Modified: / 05-09-2006 / 11:52:48 / cg" |
|
3842 | 862 |
! |
863 |
||
3863 | 864 |
createFileIn:aFile |
3842 | 865 |
"create an empty file" |
866 |
||
4584 | 867 |
|resources aStream msg file directory newName defaultFile| |
868 |
||
869 |
resources := AbstractFileBrowser classResources. |
|
3842 | 870 |
|
3863 | 871 |
aFile isDirectory ifTrue:[ |
7637 | 872 |
directory := aFile |
3863 | 873 |
] ifFalse:[ |
7637 | 874 |
directory := aFile directory. |
875 |
file := aFile |
|
3863 | 876 |
]. |
877 |
LastCreatedFile isNil ifTrue:[ |
|
7637 | 878 |
defaultFile := aFile baseName. |
3863 | 879 |
] ifFalse:[ |
7637 | 880 |
defaultFile := LastCreatedFile baseName. |
3842 | 881 |
]. |
3863 | 882 |
newName := Dialog |
7637 | 883 |
request:(resources string:'Create New File in %1:' with:directory baseName allBold) |
884 |
initialAnswer:defaultFile |
|
885 |
okLabel:(resources string:'Create') |
|
886 |
title:(resources string:'Create File') |
|
887 |
onCancel:[ |
|
888 |
self result:false. |
|
889 |
^ self |
|
890 |
]. |
|
3863 | 891 |
newName isEmpty ifTrue:[ |
7637 | 892 |
self result:false. |
3842 | 893 |
] ifFalse:[ |
7637 | 894 |
| newFile | |
895 |
newFile := directory construct:newName. |
|
896 |
newFile exists ifTrue:[ |
|
897 |
(Dialog |
|
898 |
confirm:(newName, ' already exists truncate ?') |
|
899 |
yesLabel:('Truncate') |
|
900 |
noLabel:('Cancel')) |
|
901 |
ifFalse:[ |
|
902 |
self result:false. |
|
903 |
^ self |
|
904 |
]. |
|
905 |
]. |
|
906 |
FileStream openErrorSignal handle:[:ex| |
|
907 |
msg := ('Cannot create file '', newName,'' !!') , '(' , (FileStream lastErrorString) , ')'. |
|
908 |
errorString := msg. |
|
909 |
self result:false. |
|
910 |
^ Dialog warn:errorString |
|
911 |
] do:[ |
|
912 |
aStream := newFile newReadWriteStream. |
|
913 |
]. |
|
914 |
aStream close. |
|
915 |
self createdFile:newFile. |
|
916 |
LastCreatedFile := newFile. |
|
917 |
self result:true. |
|
3842 | 918 |
]. |
3877 | 919 |
! |
920 |
||
921 |
createLinkIn:aFile soft:symbolic |
|
4788 | 922 |
"ask for the link target; |
923 |
then, create an new soft or hard link in aFile's directory" |
|
3877 | 924 |
|
4788 | 925 |
|resources newPath oldPath box string if1 if2| |
4584 | 926 |
|
927 |
resources := AbstractFileBrowser classResources. |
|
3877 | 928 |
|
10383 | 929 |
newPath := (aFile isDirectory ifTrue:[ aFile ] ifFalse:[ aFile directory ]) asValue. |
930 |
oldPath := aFile asValue. |
|
3877 | 931 |
|
932 |
box := Dialog new. |
|
4585 | 933 |
box label:'Create Link'. |
934 |
||
935 |
string := 'Create ', (symbolic ifTrue:['Symbolic'] ifFalse:['Hard']) ,' Link from:'. |
|
4584 | 936 |
(box addTextLabel:(resources string:string)) adjust:#left. |
6150
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
937 |
if1 := box addFilenameInputFieldOn:oldPath in:nil tabable:true. |
4584 | 938 |
(box addTextLabel:(resources string:'to:')) adjust:#left. |
6150
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
939 |
if2 := box addFilenameInputFieldOn:newPath in:nil value tabable:true. |
3877 | 940 |
|
941 |
box addAbortAndOkButtons. |
|
942 |
||
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6185
diff
changeset
|
943 |
aFile isDirectory ifFalse:[ |
10383 | 944 |
box focusOnField:if1. |
3877 | 945 |
]. |
946 |
box showAtPointer. |
|
947 |
||
4788 | 948 |
box accepted ifFalse:[ |
10383 | 949 |
self result:false. |
4788 | 950 |
] ifTrue:[ |
10383 | 951 |
self doCreateLinkFrom:(oldPath value) to:(newPath value) soft:symbolic. |
3877 | 952 |
]. |
10383 | 953 |
|
954 |
"Modified: / 24-07-2011 / 08:24:14 / cg" |
|
3877 | 955 |
! |
956 |
||
6150
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
957 |
doCreateLinkFrom:oldPath to:newPathArg soft:symbolic |
4788 | 958 |
"actually create a soft or hard link" |
959 |
||
6150
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
960 |
|resources err newPath newPathFile oldPathFile| |
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
961 |
|
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
962 |
newPath := newPathArg. |
4788 | 963 |
|
964 |
resources := AbstractFileBrowser classResources. |
|
965 |
||
966 |
(oldPath size == 0) ifTrue:[ |
|
7637 | 967 |
self operationError:'Missing source'. |
968 |
^ self. |
|
4788 | 969 |
]. |
970 |
(newPath size == 0) ifTrue:[ |
|
7637 | 971 |
self operationError:'Missing link name (target)'. |
972 |
^ self. |
|
4788 | 973 |
]. |
974 |
||
975 |
newPathFile := newPath asFilename. |
|
6150
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
976 |
oldPathFile := oldPath asFilename. |
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
977 |
|
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
978 |
newPathFile exists ifTrue:[ |
7637 | 979 |
newPathFile isDirectory ifTrue:[ |
980 |
newPathFile := newPathFile construct:(oldPathFile baseName). |
|
981 |
newPath := newPathFile name. |
|
982 |
]. |
|
6150
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
983 |
]. |
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
984 |
|
4788 | 985 |
newPathFile exists ifTrue:[ |
7637 | 986 |
self operationError:(resources string:'%1 already exists' with:newPath allBold). |
987 |
^ self. |
|
4788 | 988 |
]. |
6150
5028485a29c6
fixed new-symbolic link operation
Claus Gittinger <cg@exept.de>
parents:
6088
diff
changeset
|
989 |
oldPathFile exists ifFalse:[ |
7637 | 990 |
symbolic ifTrue:[ |
991 |
oldPathFile isAbsolute ifTrue:[ |
|
992 |
self operationError:(resources string:'%1 does not exist' with:oldPath allBold). |
|
993 |
^ self. |
|
994 |
]. |
|
995 |
(newPathFile directory construct:oldPath) exists ifFalse:[ |
|
996 |
Dialog warn:(resources string:'%1 does not exist (Warning only)' with:oldPath allBold). |
|
997 |
]. |
|
998 |
] ifFalse:[ |
|
999 |
self operationError:(resources string:'%1 does not exist' with:oldPath allBold). |
|
1000 |
^ self. |
|
1001 |
]. |
|
4788 | 1002 |
]. |
1003 |
((symbolic not) and:[oldPathFile isDirectory]) ifTrue:[ |
|
7637 | 1004 |
self operationError:(resources string:'%1 is a directory' with:oldPath allBold). |
1005 |
^ self. |
|
4788 | 1006 |
]. |
1007 |
ErrorSignal handle:[:ex | |
|
7637 | 1008 |
err := ex errorString. |
1009 |
self operationError:err. |
|
4788 | 1010 |
] do:[ |
7637 | 1011 |
symbolic ifTrue:[ |
1012 |
OperatingSystem createSymbolicLinkFrom:oldPath to:newPath. |
|
1013 |
] ifFalse:[ |
|
1014 |
OperatingSystem createHardLinkFrom:oldPath to:newPath |
|
1015 |
]. |
|
1016 |
self createdFile:newPathFile. |
|
1017 |
self result:true. |
|
4788 | 1018 |
]. |
3842 | 1019 |
! ! |
1020 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1021 |
|
3842 | 1022 |
!FileOperation::Delete class methodsFor:'actions'! |
1023 |
||
1024 |
deleteFile:aFileOrDirectory |
|
6168 | 1025 |
"delete aFileOrDirectory" |
3842 | 1026 |
|
1027 |
|instance| |
|
1028 |
||
1029 |
instance := self new. |
|
1030 |
instance deleteFile:aFileOrDirectory. |
|
1031 |
^ instance |
|
1032 |
! |
|
1033 |
||
6168 | 1034 |
deleteFiles:aCollectionOfFiles |
1035 |
^ self deleteFiles:aCollectionOfFiles confirm:true |
|
5081 | 1036 |
! |
1037 |
||
6168 | 1038 |
deleteFiles:aCollectionOfFiles confirm:confirm |
1039 |
"delete aCollectionOfFiles" |
|
3842 | 1040 |
|
1041 |
|instance| |
|
1042 |
||
1043 |
instance := self new. |
|
6168 | 1044 |
instance deleteFiles:aCollectionOfFiles confirm:confirm. |
3842 | 1045 |
^ instance |
1046 |
! ! |
|
1047 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1048 |
|
3842 | 1049 |
!FileOperation::Delete methodsFor:'actions'! |
1050 |
||
6373 | 1051 |
deleteFiles:colOfFiles |
1052 |
^ self deleteFiles:colOfFiles confirm:true. |
|
1053 |
! |
|
1054 |
||
1055 |
eraseFilesContentsBeforeRemoving:file |
|
1056 |
"intentionally left blank" |
|
1057 |
! ! |
|
1058 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1059 |
|
6373 | 1060 |
!FileOperation::Delete methodsFor:'actions-basic'! |
1061 |
||
3842 | 1062 |
deleteFile:aFileOrDirectory |
1063 |
| file isDirectory | |
|
1064 |
||
1065 |
aFileOrDirectory notNil ifTrue:[ |
|
7637 | 1066 |
file := aFileOrDirectory asFilename. |
3842 | 1067 |
|
7637 | 1068 |
isDirectory := file isDirectory. |
3842 | 1069 |
|
7637 | 1070 |
Error handle:[:ex| |
1071 |
"was not able to remove it" |
|
1072 |
Dialog warn:(ex description). |
|
1073 |
self errorString:(ex description). |
|
1074 |
result := false. |
|
1075 |
^ self. |
|
1076 |
] do:[ |
|
1077 |
isDirectory ifTrue:[ |
|
1078 |
file recursiveRemove |
|
1079 |
] ifFalse:[ |
|
1080 |
self eraseFilesContentsBeforeRemoving:file. |
|
1081 |
file remove |
|
1082 |
]. |
|
1083 |
]. |
|
1084 |
"/ flush parent directory or directory |
|
3842 | 1085 |
]. |
4006
8c706ba8b3b5
change flushCachedDirectory: senders to flushCachedDirectoryFor:
penk
parents:
3977
diff
changeset
|
1086 |
DirectoryContents flushCachedDirectoryFor:(file directory). |
3842 | 1087 |
result := true. |
5746
a505fc181e11
warning string (backslash in pc-filename)
Claus Gittinger <cg@exept.de>
parents:
5687
diff
changeset
|
1088 |
|
a505fc181e11
warning string (backslash in pc-filename)
Claus Gittinger <cg@exept.de>
parents:
5687
diff
changeset
|
1089 |
"Modified: / 17-03-2004 / 12:42:02 / cg" |
3842 | 1090 |
! |
1091 |
||
5081 | 1092 |
deleteFiles:colOfFiles confirm:confirm |
9576 | 1093 |
|resources answer nFilesToDelete ask labels values fileTypeString msg lbls vals dontAskForNonEmptyDirectory |
1094 |
nFilesDone| |
|
5081 | 1095 |
|
7051 | 1096 |
dontAskForNonEmptyDirectory := false. |
5081 | 1097 |
ask := confirm. |
4584 | 1098 |
resources := AbstractFileBrowser classResources. |
3842 | 1099 |
|
4701 | 1100 |
nFilesToDelete := colOfFiles size. |
9576 | 1101 |
nFilesDone := 0. |
4408
8c0c80b68ae7
ask again, if dir is not empty
Claus Gittinger <cg@exept.de>
parents:
4395
diff
changeset
|
1102 |
colOfFiles do:[:filenameOrString | |
9576 | 1103 |
|filename doDelete skip| |
4665
cd7e02bf5d85
fixed to allow deleting bad symbolic links
Claus Gittinger <cg@exept.de>
parents:
4664
diff
changeset
|
1104 |
|
9576 | 1105 |
filename := filenameOrString asFilename. |
1106 |
skip := false. |
|
1107 |
fileTypeString := ''. |
|
1108 |
filename isSymbolicLink ifTrue:[ |
|
1109 |
fileTypeString := 'symbolic link '. |
|
1110 |
] ifFalse:[ |
|
1111 |
filename exists ifFalse:[ |
|
1112 |
(Dialog |
|
1113 |
confirm:('%1 does not exist.' bindWith:filename asString allBold) |
|
1114 |
yesLabel:(resources string:'Proceed') |
|
1115 |
noLabel:(resources string:'Cancel')) |
|
1116 |
ifFalse:[ |
|
1117 |
^ self. |
|
1118 |
]. |
|
1119 |
skip := true. |
|
1120 |
] |
|
1121 |
]. |
|
1122 |
skip ifFalse:[ |
|
1123 |
ask ifTrue:[ |
|
1124 |
nFilesToDelete = 1 ifTrue:[ |
|
1125 |
labels := #('No' 'Yes'). |
|
1126 |
values := #(#no #yes). |
|
1127 |
] ifFalse:[ |
|
1128 |
labels := #('Cancel' 'No' 'Yes' 'Yes to All' ). |
|
1129 |
values := #(#cancel #no #yes #yesToAll). |
|
1130 |
]. |
|
1131 |
msg := self isErase ifTrue:'Really erase' ifFalse:'Really delete'. |
|
1132 |
msg := msg , |
|
1133 |
(nFilesToDelete = 1 |
|
1134 |
ifTrue:'\\%1%2 ?' |
|
1135 |
ifFalse:'\\%1%2 \\(%3 files alltogether)'). |
|
1136 |
answer := Dialog |
|
1137 |
confirmWithCancel:(resources |
|
1138 |
stringWithCRs:msg |
|
1139 |
with:fileTypeString |
|
1140 |
with:(filename asString allBold) |
|
1141 |
with:nFilesToDelete) |
|
1142 |
labels:(resources array:labels) |
|
1143 |
values:values |
|
1144 |
default:(values indexOf:#yes). |
|
1145 |
] ifFalse:[ |
|
1146 |
answer := #yesToAll. |
|
1147 |
]. |
|
5673 | 1148 |
|
9576 | 1149 |
answer == #cancel ifTrue:[ |
1150 |
^ self. |
|
1151 |
]. |
|
5673 | 1152 |
|
9576 | 1153 |
answer == #yesToAll ifTrue:[ |
1154 |
ask := false. |
|
1155 |
answer := #yes. |
|
1156 |
]. |
|
4408
8c0c80b68ae7
ask again, if dir is not empty
Claus Gittinger <cg@exept.de>
parents:
4395
diff
changeset
|
1157 |
|
9576 | 1158 |
answer == #yes ifTrue:[ |
1159 |
doDelete := true. |
|
1160 |
filename isSymbolicLink ifFalse:[ |
|
1161 |
dontAskForNonEmptyDirectory ifFalse:[ |
|
1162 |
filename isNonEmptyDirectory ifTrue:[ |
|
1163 |
colOfFiles size == 1 ifTrue:[ |
|
1164 |
lbls := #('Cancel' 'Remove'). |
|
1165 |
vals := #(false true). |
|
1166 |
] ifFalse:[ |
|
1167 |
lbls := #('Cancel All' 'Keep' 'Remove' 'Remove All'). |
|
1168 |
vals := #(nil false true #removeAll). |
|
1169 |
]. |
|
1170 |
doDelete := Dialog |
|
1171 |
confirmWithCancel:(resources |
|
1172 |
stringWithCRs:'Directory ''%1'' is not empty\remove anyway ?' |
|
1173 |
with:filename pathName allBold) |
|
1174 |
labels:( resources array:lbls ) |
|
1175 |
values:vals |
|
1176 |
default:(vals indexOf:true). |
|
1177 |
doDelete == nil ifTrue:[ |
|
1178 |
^ self |
|
1179 |
]. |
|
1180 |
doDelete == #removeAll ifTrue:[ |
|
1181 |
dontAskForNonEmptyDirectory := true. |
|
1182 |
doDelete := true. |
|
1183 |
]. |
|
1184 |
]. |
|
1185 |
]. |
|
1186 |
]. |
|
1187 |
doDelete ifTrue:[ |
|
1188 |
ProgressNotification progressPercentage:(nFilesDone / nFilesToDelete)*100. |
|
1189 |
self deleteFile:filename. |
|
1190 |
nFilesDone := nFilesDone + 1. |
|
1191 |
ProgressNotification progressPercentage:(nFilesDone / nFilesToDelete)*100. |
|
1192 |
] |
|
1193 |
]. |
|
1194 |
]. |
|
3842 | 1195 |
]. |
7051 | 1196 |
|
9576 | 1197 |
"Modified: / 11-10-2010 / 13:08:20 / cg" |
6168 | 1198 |
! ! |
1199 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1200 |
|
6373 | 1201 |
!FileOperation::Erase methodsFor:'actions-basic'! |
6168 | 1202 |
|
1203 |
eraseFilesContentsBeforeRemoving:file |
|
7634 | 1204 |
"fill file with zeros (to be really erased from the disk). |
1205 |
We use this, if the file contains security relevant data (such as crypto-keys)" |
|
6168 | 1206 |
|
1207 |
|writeStream fileSize remaining buffer bufferSize nWritten| |
|
1208 |
||
1209 |
fileSize := file fileSize. |
|
1210 |
writeStream := file asFilename readWriteStream. |
|
8293 | 1211 |
[ |
1212 |
remaining := fileSize. |
|
1213 |
bufferSize := 8192. |
|
1214 |
buffer := ByteArray new:bufferSize. |
|
6168 | 1215 |
|
8293 | 1216 |
[remaining > 0] whileTrue:[ |
1217 |
nWritten := writeStream |
|
1218 |
nextPutBytes:(bufferSize min:remaining) |
|
1219 |
from:buffer. |
|
1220 |
remaining := remaining - nWritten. |
|
1221 |
ProgressNotification progressPercentage:(1 - (remaining / fileSize))*100. |
|
1222 |
]. |
|
1223 |
] ensure:[ |
|
1224 |
writeStream close. |
|
6168 | 1225 |
]. |
7634 | 1226 |
|
1227 |
"Modified: / 07-02-2007 / 18:20:21 / cg" |
|
3842 | 1228 |
! ! |
1229 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1230 |
|
6285 | 1231 |
!FileOperation::Erase methodsFor:'queries'! |
1232 |
||
1233 |
isErase |
|
1234 |
^ true |
|
1235 |
! ! |
|
1236 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1237 |
|
3842 | 1238 |
!FileOperation::Move class methodsFor:'actions'! |
1239 |
||
1240 |
moveFile:aSourceFile to:aDestFile |
|
1241 |
|instance| |
|
1242 |
||
1243 |
instance := self new. |
|
1244 |
instance moveFile:aSourceFile to:aDestFile. |
|
1245 |
^ instance |
|
1246 |
! |
|
1247 |
||
1248 |
moveFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarning |
|
1249 |
|instance| |
|
1250 |
||
1251 |
instance := self new. |
|
1252 |
instance moveFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarning. |
|
1253 |
^ instance |
|
1254 |
! |
|
1255 |
||
1256 |
moveFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarning moveFileIfSame:move |
|
1257 |
|instance| |
|
1258 |
||
1259 |
instance := self new. |
|
1260 |
instance moveFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarning moveFileIfSame:move. |
|
1261 |
^ instance |
|
1262 |
! |
|
1263 |
||
1264 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
1265 |
|instance| |
|
1266 |
||
1267 |
instance := self new. |
|
1268 |
instance moveFiles:aColOfSourceFiles to:aDirectory. |
|
1269 |
^ instance |
|
1270 |
! |
|
1271 |
||
1272 |
moveFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning |
|
1273 |
|instance| |
|
1274 |
||
1275 |
instance := self new. |
|
1276 |
instance moveFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning. |
|
1277 |
^ instance |
|
1278 |
! |
|
1279 |
||
1280 |
moveFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning moveFileIfSame:move |
|
1281 |
|instance| |
|
1282 |
||
1283 |
instance := self new. |
|
1284 |
instance moveFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning moveFileIfSame:move. |
|
1285 |
^ instance |
|
1286 |
! ! |
|
1287 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1288 |
|
3842 | 1289 |
!FileOperation::Move methodsFor:'accessing'! |
1290 |
||
1291 |
colOfMovedFiles |
|
6373 | 1292 |
"obsolete - bad name" |
1293 |
||
1294 |
^ self collectionOfMovedFiles |
|
1295 |
! |
|
1296 |
||
1297 |
collectionOfMovedFiles |
|
6374 | 1298 |
movedFiles isNil ifTrue:[ |
7637 | 1299 |
movedFiles := OrderedCollection new. |
3842 | 1300 |
]. |
6374 | 1301 |
^ movedFiles |
3842 | 1302 |
! ! |
1303 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1304 |
|
3842 | 1305 |
!FileOperation::Move methodsFor:'actions'! |
1306 |
||
1307 |
moveFile:aSourceFile to:aDestFile |
|
1308 |
||
1309 |
^ self moveFile:aSourceFile to:aDestFile withOverWriteWarning:true. |
|
1310 |
! |
|
1311 |
||
1312 |
moveFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarning |
|
1313 |
||
1314 |
^ self moveFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarning moveFileIfSame:true |
|
1315 |
! |
|
1316 |
||
6373 | 1317 |
moveFiles:aColOfSourceFiles to:aDirectory |
1318 |
||
1319 |
^ self moveFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:true |
|
1320 |
! |
|
1321 |
||
1322 |
moveFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning |
|
1323 |
||
1324 |
^ self moveFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning moveFileIfSame:true |
|
1325 |
! ! |
|
1326 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1327 |
|
6373 | 1328 |
!FileOperation::Move methodsFor:'actions-basic'! |
1329 |
||
3842 | 1330 |
moveFile:aSourceFile to:aDestFile withOverWriteWarning:overWriteWarning moveFileIfSame:move |
1331 |
||
5862 | 1332 |
|newFile fileString targetDirectory targetIsDirectory suffix doMove| |
3842 | 1333 |
|
1334 |
targetIsDirectory := aDestFile isDirectory. |
|
1335 |
targetIsDirectory ifTrue:[ |
|
8361 | 1336 |
targetDirectory := aDestFile. |
1337 |
newFile := aDestFile construct:(aSourceFile baseName). |
|
3842 | 1338 |
] ifFalse:[ |
8361 | 1339 |
targetDirectory := aDestFile directory. |
1340 |
newFile := aDestFile. |
|
3842 | 1341 |
]. |
1342 |
"/ do not copy if destination directory doest exist. |
|
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6185
diff
changeset
|
1343 |
targetDirectory exists ifFalse:[ |
8361 | 1344 |
Dialog warn:'Cannot move to non-existing directory ', targetDirectory asString. |
1345 |
result := false. |
|
1346 |
^ self |
|
3842 | 1347 |
]. |
1348 |
(newFile exists) ifTrue:[ |
|
8361 | 1349 |
((newFile asString = aSourceFile asString) and:[move]) ifTrue:[ |
1350 |
[newFile exists] whileTrue:[ |
|
1351 |
suffix := newFile suffix. |
|
1352 |
fileString := newFile baseName withoutSuffix, self class suffixForCopyOverExistingFile, '.', suffix. |
|
1353 |
newFile := targetDirectory construct:fileString. |
|
1354 |
]. |
|
1355 |
] ifFalse:[ |
|
1356 |
overWriteWarning ifTrue:[ |
|
1357 |
doMove := self fileExistsDialogForNewFile:newFile oldFile:aSourceFile withCancel:false withRemoveIfSame:true. |
|
1358 |
doMove == #removeSource ifTrue:[ |
|
8397
921162bfd791
Change #halt: to #shouldImplement or #assert:
Stefan Vogel <sv@exept.de>
parents:
8361
diff
changeset
|
1359 |
self shouldImplement. |
8361 | 1360 |
result := false. |
1361 |
^ self. |
|
1362 |
]. |
|
1363 |
doMove == #removeDestination ifTrue:[ |
|
8397
921162bfd791
Change #halt: to #shouldImplement or #assert:
Stefan Vogel <sv@exept.de>
parents:
8361
diff
changeset
|
1364 |
self shouldImplement. |
8361 | 1365 |
result := false. |
1366 |
^ self. |
|
1367 |
]. |
|
1368 |
doMove == true ifFalse:[ |
|
1369 |
result := false. |
|
1370 |
^ self. |
|
1371 |
]. |
|
5862 | 1372 |
|
8361 | 1373 |
] ifFalse:[ |
1374 |
result := false. |
|
1375 |
^ self. |
|
1376 |
] |
|
1377 |
]. |
|
3842 | 1378 |
]. |
1379 |
Error handle:[:ex| |
|
8361 | 1380 |
"was not able to copy it" |
1381 |
WarningBox warn:'Error in copy file Operation: ', ex errorString. |
|
1382 |
self errorString:('Error in copy file Operation- ', ex description asString). |
|
1383 |
result := false. |
|
1384 |
^ self |
|
3842 | 1385 |
] do:[ |
8361 | 1386 |
aSourceFile moveTo:newFile. |
3842 | 1387 |
]. |
4006
8c706ba8b3b5
change flushCachedDirectory: senders to flushCachedDirectoryFor:
penk
parents:
3977
diff
changeset
|
1388 |
DirectoryContents flushCachedDirectoryFor:(aSourceFile directory). |
8c706ba8b3b5
change flushCachedDirectory: senders to flushCachedDirectoryFor:
penk
parents:
3977
diff
changeset
|
1389 |
result := true. |
3842 | 1390 |
! |
1391 |
||
1392 |
moveFiles:aColOfSourceFiles to:aDirectory withOverWriteWarning:overWriteWarning moveFileIfSame:move |
|
1393 |
||
5862 | 1394 |
|newFile suffix fileString doMove doRemoveSource doRemoveDestination| |
3842 | 1395 |
|
5854
8c6042ba7495
ask if non-existing directory should be created
Claus Gittinger <cg@exept.de>
parents:
5846
diff
changeset
|
1396 |
aDirectory exists ifFalse:[ |
11444 | 1397 |
(Dialog confirm:(FileBrowser classResources |
1398 |
stringWithCRs:'Non-existing directory "%1" .\Create ?' |
|
1399 |
with:aDirectory asString allBold)) ifFalse:[ |
|
1400 |
result := false. |
|
1401 |
^ self |
|
1402 |
]. |
|
1403 |
aDirectory makeDirectory. |
|
1404 |
aDirectory exists ifFalse:[ |
|
1405 |
Dialog warn:(FileBrowser classResources |
|
1406 |
stringWithCRs:'Cannot create directory "%1" !!\Create ?.' |
|
1407 |
with:aDirectory asString allBold). |
|
1408 |
result := false. |
|
1409 |
^ self |
|
1410 |
] |
|
3842 | 1411 |
]. |
5788 | 1412 |
(aDirectory isDirectory) ifFalse:[ |
11444 | 1413 |
Dialog warn:('Destination %1 is not a directory.' bindWith:aDirectory asString allBold). |
1414 |
result := false. |
|
1415 |
^ self |
|
3842 | 1416 |
]. |
1417 |
aColOfSourceFiles do:[: filename | |
|
11444 | 1418 |
newFile := aDirectory construct:filename baseName. |
5790 | 1419 |
|
11444 | 1420 |
doMove := true. |
1421 |
doRemoveSource := false. |
|
1422 |
doRemoveDestination := false. |
|
5862 | 1423 |
|
11444 | 1424 |
(newFile exists) ifTrue:[ |
1425 |
((newFile asString = filename asString) and:[move]) ifTrue:[ |
|
1426 |
[newFile exists] whileTrue:[ |
|
1427 |
suffix := newFile suffix. |
|
1428 |
fileString := newFile withoutSuffix baseName , self class suffixForCopyOverExistingFile, '.', suffix. |
|
1429 |
newFile := aDirectory construct:fileString. |
|
1430 |
]. |
|
1431 |
] ifFalse:[ |
|
1432 |
overWriteWarning ifTrue:[ |
|
1433 |
(doMove := actionForAll) isNil ifTrue:[ |
|
1434 |
doMove := self |
|
1435 |
fileExistsDialogForNewFile:newFile oldFile:filename |
|
1436 |
withCancel:(aColOfSourceFiles size > 1) withRemoveIfSame:true |
|
1437 |
withAllAction: true. |
|
1438 |
doMove isNil ifTrue:[ "/ cancel |
|
1439 |
result := false. |
|
1440 |
^ self. |
|
1441 |
]. |
|
1442 |
]. |
|
1443 |
(doMove == #removeSource) ifTrue:[ |
|
1444 |
doRemoveSource := true. |
|
1445 |
doMove := false |
|
1446 |
] ifFalse:[ |
|
1447 |
(doMove == #removeDestination) ifTrue:[ |
|
1448 |
doRemoveDestination := true. |
|
1449 |
doMove := false |
|
1450 |
] |
|
1451 |
] |
|
1452 |
] |
|
1453 |
]. |
|
1454 |
]. |
|
4522 | 1455 |
|
11444 | 1456 |
(doMove or:[doRemoveSource or:[doRemoveDestination]]) ifTrue:[ |
1457 |
Error handle:[:ex| |
|
1458 |
"was not able to copy it" |
|
1459 |
|descriptionString| |
|
5862 | 1460 |
|
11444 | 1461 |
result := false. |
1462 |
descriptionString := ex description asString. |
|
1463 |
self errorString:(' Error in Move-File Operation:', descriptionString). |
|
1464 |
( Dialog |
|
1465 |
confirm:(' Error in Move-File Operation: ', descriptionString) |
|
1466 |
title:'Move' |
|
1467 |
yesLabel:'Continue' |
|
1468 |
noLabel:'Abort' |
|
1469 |
) ifFalse:[ |
|
1470 |
^ self. |
|
1471 |
]. |
|
1472 |
] do:[ |
|
1473 |
doRemoveSource ifTrue:[ |
|
1474 |
filename remove |
|
1475 |
] ifFalse:[ |
|
1476 |
doRemoveDestination ifTrue:[ |
|
1477 |
newFile remove |
|
1478 |
] ifFalse:[ |
|
1479 |
filename moveTo:newFile. |
|
1480 |
] |
|
1481 |
] |
|
1482 |
]. |
|
1483 |
self collectionOfMovedFiles add:filename |
|
1484 |
] |
|
3842 | 1485 |
]. |
4006
8c706ba8b3b5
change flushCachedDirectory: senders to flushCachedDirectoryFor:
penk
parents:
3977
diff
changeset
|
1486 |
DirectoryContents flushCachedDirectoryFor:aDirectory. |
3842 | 1487 |
result := true. |
11444 | 1488 |
|
1489 |
"Modified: / 20-03-2012 / 11:53:35 / cg" |
|
3842 | 1490 |
! ! |
1491 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1492 |
|
3842 | 1493 |
!FileOperation::Rename class methodsFor:'actions'! |
1494 |
||
1495 |
renameFile:oldFile to:newName |
|
1496 |
|instance| |
|
1497 |
||
1498 |
instance := self new. |
|
1499 |
instance renameFile:oldFile to:newName. |
|
1500 |
^ instance |
|
1501 |
! |
|
1502 |
||
7637 | 1503 |
renameFiles:aColOfFiles |
3842 | 1504 |
|instance| |
1505 |
||
1506 |
instance := self new. |
|
1507 |
instance renameFiles:aColOfFiles. |
|
1508 |
^ instance |
|
1509 |
! ! |
|
1510 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1511 |
|
3842 | 1512 |
!FileOperation::Rename methodsFor:'accessing'! |
1513 |
||
1514 |
renamedFiles |
|
1515 |
renamedFiles isNil ifTrue:[ |
|
7637 | 1516 |
renamedFiles := OrderedCollection new. |
3842 | 1517 |
]. |
1518 |
^ renamedFiles |
|
1519 |
! ! |
|
1520 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1521 |
|
6373 | 1522 |
!FileOperation::Rename methodsFor:'actions-basic'! |
3842 | 1523 |
|
1524 |
renameFile:oldFile to:newName |
|
1525 |
"rename a file (or directory)" |
|
1526 |
||
7334
e0bd092badd1
care for same-name rename on OS which is not filename-case-sensitive
Claus Gittinger <cg@exept.de>
parents:
7084
diff
changeset
|
1527 |
|newFile msg resources sameFile| |
3842 | 1528 |
|
1529 |
(oldFile isNil or:[newName isNil]) ifTrue:[ |
|
7637 | 1530 |
result := false. |
1531 |
^ self. |
|
3842 | 1532 |
]. |
1533 |
(oldFile asString isBlank or:[newName isBlank]) ifTrue:[ |
|
7637 | 1534 |
result := false. |
1535 |
^ self. |
|
3842 | 1536 |
]. |
5656 | 1537 |
newName asFilename isAbsolute ifTrue:[ |
7637 | 1538 |
newFile := newName asFilename. |
5656 | 1539 |
] ifFalse:[ |
7637 | 1540 |
(oldFile baseName = newName) ifTrue:[ |
1541 |
result := false |
|
1542 |
]. |
|
1543 |
newFile := oldFile directory construct:newName. |
|
3842 | 1544 |
]. |
1545 |
||
5656 | 1546 |
oldFile pathName = newFile pathName ifTrue:[ |
7637 | 1547 |
^ self. |
4674
64a49fadc47e
do op if newName is same as old in a rename operation
Claus Gittinger <cg@exept.de>
parents:
4665
diff
changeset
|
1548 |
]. |
7334
e0bd092badd1
care for same-name rename on OS which is not filename-case-sensitive
Claus Gittinger <cg@exept.de>
parents:
7084
diff
changeset
|
1549 |
Filename isCaseSensitive ifFalse:[ |
7637 | 1550 |
sameFile := (oldFile pathName sameAs: newFile pathName) |
7334
e0bd092badd1
care for same-name rename on OS which is not filename-case-sensitive
Claus Gittinger <cg@exept.de>
parents:
7084
diff
changeset
|
1551 |
] ifTrue:[ |
7637 | 1552 |
sameFile := false |
7334
e0bd092badd1
care for same-name rename on OS which is not filename-case-sensitive
Claus Gittinger <cg@exept.de>
parents:
7084
diff
changeset
|
1553 |
]. |
4674
64a49fadc47e
do op if newName is same as old in a rename operation
Claus Gittinger <cg@exept.de>
parents:
4665
diff
changeset
|
1554 |
|
5656 | 1555 |
resources := Dialog classResources. |
1556 |
||
3842 | 1557 |
OperatingSystem errorSignal handle:[:ex| |
7637 | 1558 |
msg := resources |
1559 |
stringWithCRs:'Cannot rename file %1 to %2 !!\\(%3)' |
|
1560 |
with:oldFile baseName |
|
1561 |
with:newName |
|
1562 |
with:(OperatingSystem lastErrorString). |
|
1563 |
Dialog warn:msg. |
|
1564 |
result := false. |
|
1565 |
^ self. |
|
3842 | 1566 |
] do:[ |
7637 | 1567 |
sameFile ifFalse:[ |
1568 |
newFile exists ifTrue:[ |
|
1569 |
(newFile sameContentsAs:oldFile) ifTrue:[ |
|
1570 |
msg := '%1 exists [with same contents] - rename (i.e. overwrite) anyway ?' |
|
1571 |
] ifFalse:[ |
|
1572 |
msg := '%1 exists - rename (i.e. overwrite) anyway ?' |
|
1573 |
]. |
|
1574 |
(Dialog confirmWithCancel:(resources string:msg with:newName allBold) default:false) ifFalse:[ |
|
1575 |
result := false. |
|
1576 |
^ self. |
|
1577 |
] |
|
1578 |
]. |
|
1579 |
]. |
|
1580 |
oldFile renameTo:newFile. |
|
1581 |
self renamedFiles add:newFile. |
|
3842 | 1582 |
]. |
1583 |
result := true. |
|
7334
e0bd092badd1
care for same-name rename on OS which is not filename-case-sensitive
Claus Gittinger <cg@exept.de>
parents:
7084
diff
changeset
|
1584 |
|
e0bd092badd1
care for same-name rename on OS which is not filename-case-sensitive
Claus Gittinger <cg@exept.de>
parents:
7084
diff
changeset
|
1585 |
"Modified: / 21-09-2006 / 18:32:12 / cg" |
3842 | 1586 |
! |
1587 |
||
7637 | 1588 |
renameFiles:aColOfFiles |
5827 | 1589 |
|resources queryBox b lastNewName lastOldName initialText oldName newName renameAll doRename| |
4584 | 1590 |
|
1591 |
resources := AbstractFileBrowser classResources. |
|
5827 | 1592 |
renameAll := false. |
3842 | 1593 |
|
1594 |
queryBox := FilenameEnterBox new. |
|
4584 | 1595 |
queryBox okText:(resources string:'Rename'). |
5827 | 1596 |
|
3842 | 1597 |
aColOfFiles size > 1 ifTrue:[ |
7637 | 1598 |
b := queryBox addAbortButtonLabelled:(resources string:'Cancel All'). |
1599 |
b action:[^ self]. |
|
1600 |
queryBox addButton:(Button label:(resources string:'Rename All') action:[renameAll := true. queryBox okPressed]) before:(queryBox okButton). |
|
3842 | 1601 |
]. |
5827 | 1602 |
aColOfFiles do:[:oldFile | |
7637 | 1603 |
oldName := oldFile baseName asString. |
1604 |
lastNewName notNil ifTrue:[ |
|
1605 |
initialText := FileBrowser goodRenameDefaultForFile:oldName lastOld:lastOldName lastNew:lastNewName. |
|
1606 |
]. |
|
1607 |
doRename := false. |
|
1608 |
(renameAll and:[initialText notNil]) ifTrue:[ |
|
1609 |
doRename := true. |
|
1610 |
newName := initialText. |
|
1611 |
] ifFalse:[ |
|
1612 |
queryBox title:(resources string:'Rename %1 to:' with:(oldName allBold)). |
|
1613 |
queryBox initialText:(initialText ? oldName). |
|
1614 |
queryBox action:[:newEnteredName | newName := newEnteredName. doRename := true.]. |
|
1615 |
queryBox show "showAtPointer". |
|
1616 |
"/ queryBox accepted ifFalse:[self halt]. |
|
1617 |
]. |
|
1618 |
doRename ifTrue:[ |
|
1619 |
(self renameFile:oldFile to:newName asString) ifTrue:[ |
|
1620 |
result := true |
|
1621 |
]. |
|
1622 |
lastOldName := oldName. |
|
1623 |
lastNewName := newName. |
|
1624 |
]. |
|
3842 | 1625 |
] |
1626 |
! ! |
|
1627 |
||
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1628 |
|
3841 | 1629 |
!FileOperation class methodsFor:'documentation'! |
1630 |
||
1631 |
version |
|
11444 | 1632 |
^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.90 2012-03-20 11:01:05 cg Exp $' |
9501 | 1633 |
! |
1634 |
||
1635 |
version_CVS |
|
11444 | 1636 |
^ '$Header: /cvs/stx/stx/libtool/FileOperation.st,v 1.90 2012-03-20 11:01:05 cg Exp $' |
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
1637 |
! |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
1638 |
|
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
1639 |
version_SVN |
12205 | 1640 |
^ '$Id: FileOperation.st 7952 2012-03-21 17:50:14Z vranyj1 $' |
3841 | 1641 |
! ! |
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
1642 |