4 Original GPL release version 4.12
5 Copyright 1993-2000 Jonathan Potter
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 All users of Directory Opus 4 (including versions distributed
22 under the GPL) are entitled to upgrade to the latest version of
23 Directory Opus version 5 at a reduced price. Please see
24 http://www.gpsoft.com.au for more information.
26 The release of Directory Opus 4 under the GPL in NO WAY affects
27 the existing commercial status of Directory Opus 5.
37 char buf
[FILEBUF_SIZE
],buf1
[256];
38 struct Directory
*dev
,*next
;
41 if (status_iconified
) return;
44 if (checkdevtot(dopus_curwin
[data_active_window
])) {
45 dev
=dopus_curwin
[data_active_window
]->firstentry
;
48 if ((dev
->selected
) && (dev
->type
==ENTRY_DEVICE
) &&
49 ((dev
->size
==DLT_DIRECTORY
) || (dev
->size
==DLT_LATE
) || (dev
->size
==DLT_NONBINDING
))) {
52 expand_path(dev
->name
,buf1
);
53 if ((!whatsit(globstring
[STR_ENTER_ASSIGN_NAME
],256,buf1
,(char *)-1))) {
57 if (buf1
[0]==0) blank
=1;
59 strcpy(buf
,dev
->name
); buf
[(strlen(buf
)-1)]=0;
60 if (blank
) a
= AssignLock(buf
,NULL
);
61 else switch (dev
->size
)
64 if ((lock
= Lock(buf1
, ACCESS_READ
)))
66 if (!(a
= AssignLock(buf
,lock
))) UnLock(lock
);
71 a
= AssignLate(buf
,buf1
);
74 a
= AssignPath(buf
,buf1
);
77 // a = Assign(buf,blank ? NULL : buf1);
78 if (!a
) dostatustext(globstring
[STR_CANT_CANCEL_ASSIGN
]);
81 if (blank
) removefile(dev
,dopus_curwin
[data_active_window
],data_active_window
,TRUE
);
82 else unselect(data_active_window
,dev
);
90 if (str_pathbuffer
[data_active_window
][0]==0) return;
92 if ((!whatsit(globstring
[STR_ENTER_DEVICE_NAME
],31,buf
,NULL
))) {
97 else strcpy(buf
,rexx_args
[0]);
98 for (a
=0;a
<strlen(buf
);a
++)
99 if (buf
[a
]==':' || buf
[a
]=='/') buf
[a
]=0;
100 if (!(Assign(buf
,str_pathbuffer
[data_active_window
]))) okay();
101 else dostatustext(globstring
[STR_ASSIGN_FAILED
]);
107 if (!status_iconified
&& w
>-1 && str_pathbuffer
[w
][0]==0) {
108 dostatustext(globstring
[STR_NO_DESTINATION_SELECTED
]);
109 simplerequest(globstring
[STR_NO_DESTINATION_SELECTED
],
110 globstring
[STR_CONTINUE
],NULL
);
116 int checksame(src
,dst
,type
)
123 if (!(lk1
=Lock(src
,ACCESS_READ
))) return(LOCK_DIFFERENT
);
124 if (!(lk2
=Lock(dst
,ACCESS_READ
))) {
126 return(LOCK_DIFFERENT
);
128 ret
= SameLock(lk1
,lk2
);
129 if ((ret
== LOCK_SAME
) && (type
< 2))
131 int a
= (type
? STR_CANT_OVERCOPY_FILES
: STR_CANT_COPY_DIR_TO_ITSELF
);
132 dostatustext(globstring
[a
]);
133 simplerequest(globstring
[a
],globstring
[STR_CONTINUE
],NULL
);
140 int expand_path(path
,buffer
)
147 save
=main_proc
->pr_WindowPtr
;
148 main_proc
->pr_WindowPtr
=(APTR
)-1;
150 if ((lock
=Lock(path
,ACCESS_READ
))) {
151 PathName(lock
,buffer
,256);
156 main_proc
->pr_WindowPtr
=save
;