equal
deleted
inserted
replaced
3225 doAddArchiver |
3225 doAddArchiver |
3226 |files| |
3226 |files| |
3227 |
3227 |
3228 files := self currentSelectedFiles. |
3228 files := self currentSelectedFiles. |
3229 files size == 1 ifFalse:[ |
3229 files size == 1 ifFalse:[ |
3230 Dialog information:'Select exactly one archive.'. |
3230 Dialog information:(resources string:'Select exactly one archive.'). |
3231 ^ self |
3231 ^ self |
3232 ]. |
3232 ]. |
3233 |
3233 |
3234 self |
3234 self |
3235 applicationNamed:#FileApplicationNoteBook |
3235 applicationNamed:#FileApplicationNoteBook |
3236 ifPresentDo:[:appl | appl doAddArchiverOn:files first]. |
3236 ifPresentDo:[:appl | appl doAddArchiverOn:files first]. |
3237 |
3237 |
3238 "Created: / 29-11-2011 / 19:01:31 / cg" |
3238 "Created: / 29-11-2011 / 19:01:31 / cg" |
|
3239 "Modified: / 29-11-2017 / 12:25:47 / cg" |
3239 ! |
3240 ! |
3240 |
3241 |
3241 doAddTerminal |
3242 doAddTerminal |
3242 |dir| |
3243 |dir| |
3243 |
3244 |
5251 |
5252 |
5252 |selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
5253 |selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
5253 |
5254 |
5254 directory := self currentDirectory. |
5255 directory := self currentDirectory. |
5255 directory isNil ifTrue:[ |
5256 directory isNil ifTrue:[ |
5256 self warn:'Select a single directory to create a directory'. |
5257 self warn:(resources string:'Select a single directory to create a directory'). |
5257 ^ self |
5258 ^ self |
5258 ]. |
5259 ]. |
5259 |
5260 |
5260 "/ clever default if selection is an archive... |
5261 "/ clever default if selection is an archive... |
5261 selectedFiles := self currentSelectedFiles. |
5262 selectedFiles := self currentSelectedFiles. |
5282 createOp result ifFalse:[ ^ self]. |
5283 createOp result ifFalse:[ ^ self]. |
5283 newFile := createOp createdFile. |
5284 newFile := createOp createdFile. |
5284 newFile notNil ifTrue:[ |
5285 newFile notNil ifTrue:[ |
5285 self updateCurrentDirectory. |
5286 self updateCurrentDirectory. |
5286 ] |
5287 ] |
|
5288 |
|
5289 "Modified: / 29-11-2017 / 12:26:41 / cg" |
5287 ! |
5290 ! |
5288 |
5291 |
5289 newFile |
5292 newFile |
5290 "ask for and create a new file" |
5293 "ask for and create a new file" |
5291 |
5294 |
5292 | curFile directory create file| |
5295 | curFile directory create file| |
5293 |
5296 |
5294 directory := self currentDirectory. |
5297 directory := self currentDirectory. |
5295 directory isNil ifTrue:[ |
5298 directory isNil ifTrue:[ |
5296 self warn:'Select a single directory to create a file.'. |
5299 self warn:(resources string:'Select a single directory to create a file.'). |
5297 ^ self. |
5300 ^ self. |
5298 ]. |
5301 ]. |
5299 |
5302 |
5300 curFile := self firstSelectedFile. |
5303 curFile := self firstSelectedFile. |
5301 curFile notNil ifTrue:[ |
5304 curFile notNil ifTrue:[ |
5304 file := directory. |
5307 file := directory. |
5305 ]. |
5308 ]. |
5306 create := FileOperation createFileIn:file. |
5309 create := FileOperation createFileIn:file. |
5307 create result ifFalse:[ ^ self]. |
5310 create result ifFalse:[ ^ self]. |
5308 self updateAndSelect:(OrderedCollection with:(create createdFile)). |
5311 self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
5312 |
|
5313 "Modified: / 29-11-2017 / 12:26:51 / cg" |
5309 ! |
5314 ! |
5310 |
5315 |
5311 newHardLink |
5316 newHardLink |
5312 "ask for and create a hard link (unix only)" |
5317 "ask for and create a hard link (unix only)" |
5313 |
5318 |
5319 |
5324 |
5320 | sel dir create createdFile| |
5325 | sel dir create createdFile| |
5321 |
5326 |
5322 sel := self currentSelectedObjects. |
5327 sel := self currentSelectedObjects. |
5323 (sel size ~= 1) ifTrue:[ |
5328 (sel size ~= 1) ifTrue:[ |
5324 self warn:'Select one directory to link'. |
5329 self warn:(resources string:'Select one directory to link'). |
5325 ^ self |
5330 ^ self |
5326 ]. |
5331 ]. |
5327 dir := sel first. |
5332 dir := sel first. |
5328 |
5333 |
5329 create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
5334 create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
5335 ] ifFalse:[ |
5340 ] ifFalse:[ |
5336 self updateAndSelect:(OrderedCollection with:createdFile). |
5341 self updateAndSelect:(OrderedCollection with:createdFile). |
5337 ] |
5342 ] |
5338 ]. |
5343 ]. |
5339 |
5344 |
5340 "Modified: / 04-12-2006 / 13:15:15 / cg" |
5345 "Modified: / 29-11-2017 / 12:26:58 / cg" |
5341 ! |
5346 ! |
5342 |
5347 |
5343 newSoftLink |
5348 newSoftLink |
5344 "ask for and create a soft link (unix only)" |
5349 "ask for and create a soft link (unix only)" |
5345 |
5350 |
6911 ! |
6916 ! |
6912 |
6917 |
6913 fetchFileByURL |
6918 fetchFileByURL |
6914 |url destinationFilename| |
6919 |url destinationFilename| |
6915 |
6920 |
6916 url := Dialog request:'URL to Fetch:' initialAnswer:'http://host/path'. |
6921 url := Dialog request:(resources string:'URL to Fetch:') initialAnswer:'http://host/path'. |
6917 url isEmptyOrNil ifTrue:[^ self]. |
6922 url isEmptyOrNil ifTrue:[^ self]. |
6918 url := url asURL. |
6923 url := url asURL. |
6919 |
6924 |
6920 destinationFilename := Dialog request:'Download As:' initialAnswer:(UnixFilename named:url path) baseName. |
6925 destinationFilename := Dialog request:(resources string:'Download As:') initialAnswer:(UnixFilename named:url path) baseName. |
6921 destinationFilename isEmptyOrNil ifTrue:[^ self]. |
6926 destinationFilename isEmptyOrNil ifTrue:[^ self]. |
6922 |
6927 |
6923 destinationFilename := self currentDirectory asFilename / destinationFilename. |
6928 destinationFilename := self currentDirectory asFilename / destinationFilename. |
6924 destinationFilename exists ifTrue:[ |
6929 destinationFilename exists ifTrue:[ |
6925 |answer| |
6930 |answer| |
6933 self notify:(resources string:'Fetching %1' with:url). |
6938 self notify:(resources string:'Fetching %1' with:url). |
6934 HTTPInterface get:url destinationFile:destinationFilename. |
6939 HTTPInterface get:url destinationFile:destinationFilename. |
6935 self notify:nil. |
6940 self notify:nil. |
6936 ] |
6941 ] |
6937 |
6942 |
6938 "Modified: / 20-05-2010 / 11:15:35 / cg" |
6943 "Modified: / 29-11-2017 / 12:26:13 / cg" |
6939 ! |
6944 ! |
6940 |
6945 |
6941 fileContentsAsByteArray |
6946 fileContentsAsByteArray |
6942 |file fileSize| |
6947 |file fileSize| |
6943 |
6948 |