Issue 21747 - Directory lock until quickstarter closed
Summary: Directory lock until quickstarter closed
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: current
Hardware: PC Windows 2000
: P3 Trivial with 8 votes (vote)
Target Milestone: 3.4.0
Assignee: thorsten.martens
QA Contact: issues@framework
URL:
Keywords: oooqa
: 19453 20583 25935 30890 30944 32722 37485 38613 38826 41019 41080 42167 44712 46659 46782 48221 48634 50088 50459 50707 55471 55742 59066 62590 68801 69435 69907 70577 74558 96812 (view as issue list)
Depends on:
Blocks:
 
Reported: 2003-10-27 09:26 UTC by tfrab
Modified: 2010-11-28 18:20 UTC (History)
15 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Small delphi project that has one solution (197.58 KB, application/x-compressed)
2005-03-10 12:28 UTC, ivaroo
no flags Details
proposed patch (2.44 KB, patch)
2006-07-26 22:12 UTC, Giuseppe Castagno (aka beppec56)
no flags Details | Diff
updated version, built against m178. (2.68 KB, patch)
2006-07-27 21:16 UTC, Giuseppe Castagno (aka beppec56)
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description tfrab 2003-10-27 09:26:57 UTC
If I open a file on a pendrive using OO.org I'm unable to unmount the device if I don't close the 
OO.org quickstarter utility. just a little bug but can be confusing for inexperienced users.
Found on a PC with windows 2000 sp4 and OO.org 1.03 and 1.1

Regards

Marco Berrettini
Comment 1 utomo99 2003-10-29 09:10:16 UTC
change from test.
CMIIW
Comment 2 hans_werner67 2003-11-03 13:26:03 UTC
Hi, please note!
If this defect is a real issue, please change the component, cause
testproduct is only for testing. Otherwise close the issue.

Thank you
Comment 3 tfrab 2003-11-04 10:56:16 UTC
component has been changed to framework, subcomponent code
Comment 4 tfrab 2003-11-04 11:15:03 UTC
should be the right subcomponent (I hope :))
Comment 5 thorsten.martens 2003-11-11 14:57:05 UTC
TM->HRO: As talked about, please have a look. Thanks !
Comment 6 thorsten.martens 2003-11-11 15:05:51 UTC
TM->HRO: As talked about, please have a look. Thanks !
Comment 7 hennes.rohling 2003-11-24 15:17:36 UTC
The Windows "Black box" System File Open Dialog sets the current
working directory to the directory where the last file was openend
from. That locks the directory and prevents the volume from unmounting.

hro@tra: After system file open dialog is closed remember the
directory, set the current working directory to somewhere uncritical
(Home Dir, Office program dir). When the dialog is openend the next
time restore the remebered directory.
Comment 8 hennes.rohling 2004-02-27 12:23:29 UTC
*** Issue 25935 has been marked as a duplicate of this issue. ***
Comment 9 Martin Hollmichel 2004-05-28 15:13:19 UTC
according to the announcement on releases
(http://www.openoffice.org/servlets/ReadMsg?list=releases&msgNo=7503) this issue
will be re-targeted to OOo Later.
Comment 10 thorsten.martens 2004-08-10 09:41:56 UTC
*** Issue 32722 has been marked as a duplicate of this issue. ***
Comment 11 flibby05 2005-01-21 20:48:55 UTC
*** Issue 41080 has been marked as a duplicate of this issue. ***
Comment 12 flibby05 2005-01-21 20:53:11 UTC
*** Issue 37485 has been marked as a duplicate of this issue. ***
Comment 13 flibby05 2005-01-21 21:45:58 UTC
*** Issue 41019 has been marked as a duplicate of this issue. ***
Comment 14 flibby05 2005-01-21 22:45:03 UTC
*** Issue 20583 has been marked as a duplicate of this issue. ***
Comment 15 flibby05 2005-01-22 12:02:12 UTC
*** Issue 19453 has been marked as a duplicate of this issue. ***
Comment 16 flibby05 2005-01-22 12:03:22 UTC
.
Comment 17 flibby05 2005-01-22 12:03:59 UTC
remove dep to 19453
Comment 18 ivaroo 2005-01-22 13:19:29 UTC
Only CC Spam
Comment 19 flibby05 2005-03-08 20:52:18 UTC
*** Issue 42167 has been marked as a duplicate of this issue. ***
Comment 20 flibby05 2005-03-10 09:28:56 UTC
respectfully i'd like to nominate this issue for 2.0, 2.0.1,..
Comment 21 flibby05 2005-03-10 09:29:57 UTC
*** Issue 38613 has been marked as a duplicate of this issue. ***
Comment 22 tino.rachui 2005-03-10 09:59:26 UTC
Because of resource bottlenecks it is impossible to fix this for OOo 2.0. But
everybody is invited to submit a patch for this Window FileOpen dialog bug. 
Sorry and regards,
Tino
Comment 23 ivaroo 2005-03-10 12:28:14 UTC
Created attachment 23636 [details]
Small delphi project that has one solution
Comment 24 ivaroo 2005-03-10 12:32:22 UTC
I think it has to do with the current directory setting that Windows does. As
OOo  is started it gets the current dir of the document. 
I have attached a small program with source code that makes this clear. 
if you press the button it changes the current directory to the exe directory
and you can unmount the dir. Windows gives the complete path of the file so you
are normally not interesed in the current dir.
Comment 25 ivaroo 2005-03-10 12:43:42 UTC
Sorry for the amount of spam, but i forgot to explain how to test with my small
program. put the exe somewhere (e.g. on your desktop) create a folder (e.g.
testing) on the desktop. create a file with a strange extention (e.g. test.gxh ). 
rightclik on this file and select 'open with' connect the exe permanently to
this filetype. doubleclick the file.
he tool will show some info of the 'surroundings' of the program. 
try to delete the folder (this is not allowed)
click the botton conviniently placed smack in the middle
try to delete the folder (this is allowed, folder is gone)

The same works if you put the file on a memory stick or anything else.

I hope someone can put this one line of code somewhere.
Comment 26 flibby05 2005-03-10 21:26:34 UTC
*** Issue 30944 has been marked as a duplicate of this issue. ***
Comment 27 flibby05 2005-03-11 10:00:12 UTC
*** Issue 30890 has been marked as a duplicate of this issue. ***
Comment 28 flibby05 2005-03-12 14:42:56 UTC
*** Issue 38826 has been marked as a duplicate of this issue. ***
Comment 29 lohmaier 2005-04-11 00:28:20 UTC
*** Issue 46659 has been marked as a duplicate of this issue. ***
Comment 30 flibby05 2005-04-21 17:00:15 UTC
*** Issue 46782 has been marked as a duplicate of this issue. ***
Comment 31 flibby05 2005-04-21 17:00:55 UTC
set prio P4 -> P3, because of amount of duplicates
Comment 32 flibby05 2005-05-03 20:07:23 UTC
*** Issue 48221 has been marked as a duplicate of this issue. ***
Comment 33 flibby05 2005-05-03 20:08:25 UTC
*** Issue 48634 has been marked as a duplicate of this issue. ***
Comment 34 Olaf Felka 2005-06-08 08:52:42 UTC
*** Issue 50459 has been marked as a duplicate of this issue. ***
Comment 35 tino.rachui 2005-06-13 12:46:28 UTC
Reassigned for change of responsibilities sake.
Comment 36 thorsten.martens 2005-06-16 08:29:05 UTC
*** Issue 50707 has been marked as a duplicate of this issue. ***
Comment 37 thorsten.martens 2005-06-16 13:13:15 UTC
*** Issue 50088 has been marked as a duplicate of this issue. ***
Comment 38 flibby05 2005-10-05 22:12:56 UTC
*** Issue 55471 has been marked as a duplicate of this issue. ***
Comment 39 Regina Henschel 2005-10-10 22:02:38 UTC
*** Issue 55742 has been marked as a duplicate of this issue. ***
Comment 40 ace_dent 2006-02-21 18:42:12 UTC
*** Issue 59066 has been marked as a duplicate of this issue. ***
Comment 41 andreschnabel 2006-02-26 22:50:33 UTC
*** Issue 62590 has been marked as a duplicate of this issue. ***
Comment 42 ace_dent 2006-02-26 23:07:12 UTC
Based on number of duplicate Issues (20+ !) and Votes, can we please set a
Target milestone...

Regards,
Andrew
Comment 43 hennes.rohling 2006-02-28 14:55:58 UTC
The behaviour is an implementation detail of the Windows system file open dialog 
(Black box). It sets the process CWD to the last selected path. This locks the 
path f.e. you won't be able to remove a CD from the drive.

You'll experience the same when you are using Notepad, Wordpad or even 
Microsoft Office (beside their dialogs are a reimplementation of the Windows 
system dialogs).

This is common on Windows for most applications due to Windows internals and 
can easily be workarounded by traveling to another directory with the FO-Dialog.
Comment 44 andreschnabel 2006-03-01 19:16:18 UTC
sometimes it would be less work to fix the issue than to close a lot of
duplicates, discuss with users and tell constantly the same things.

Yes .. it is a windows issue, that should be fixed in Windows. But ok .. if we
want to have to have another 20 duplicates before getting this fixed .. may it be.
Comment 45 Olaf Felka 2006-03-07 09:25:52 UTC
*** Issue 62492 has been marked as a duplicate of this issue. ***
Comment 46 Olaf Felka 2006-03-07 09:56:42 UTC
*** Issue 62492 has been marked as a duplicate of this issue. ***
Comment 47 intersol 2006-03-07 10:36:47 UTC
i think that target 3.0 is not appropiate for this bug (special kind of issue).
I suggest setting it for 2.0.x (probably 2.0.3 because 2.0.2 it's in RC)
Comment 48 hennes.rohling 2006-04-12 17:07:50 UTC
*** Issue 44712 has been marked as a duplicate of this issue. ***
Comment 49 Giuseppe Castagno (aka beppec56) 2006-07-26 22:12:43 UTC
Created attachment 38055 [details]
proposed patch
Comment 50 Giuseppe Castagno (aka beppec56) 2006-07-26 22:14:39 UTC
The file I attached is a proposed patch, applies to file
fpicker/source/win32/filepicker/getfilenamewrapper.cxx only (gsl then ?); I
built it with 2.0.3 sources.
I checked it on Windows XP Home, using a USB stick and there it worked.
I used two functions from the Visual C++ CRT (_wgetcwd / _wchdir) and I choose
an automatic variable as a temporary buffer to store the path before calling the
standard Windows dialogs.
The temporary path buffer size is fixed to 1500 characters, so with (unpratical
I think) long paths the bug will show up again.
A better solution could have been using malloc/free for a better buffer
management, but I didn't know there in win32 interface if that was safe
(fragmentation, trashing, etc..).
According to the documentation I have with the compiler, _wgetcwd / _wchdir are
OK for Windows NT, 2000, XP and Unicode.
I'm not sure of unicows.dll effects about this on Win 98, Me, 95.

A better implementation would have been forcing a fixed path on exiting the
Windows function, but I don't know how to pick up a suitable path (the default
user path or the application start path), especially from inside win32
abstraction layer.
I can do this if someone gives me some direction, though.

To test, do as described at the beginning of the issue, but this time as soon as
OOo closes the document, the stick can be unmounted (using the icon to the
desktop lower right).
Comment 51 kendy 2006-07-27 09:33:49 UTC
Issue type PATCH, target 2.x...
Comment 52 andreschnabel 2006-07-27 18:34:10 UTC
beppec56: 
could you check if your patch does not break expected behaviour? The file open /
save dialog should always show the path, where the recent document has been
loaded from / saved to. 
(tnanks for taking care about this nasty issue)
Comment 53 Giuseppe Castagno (aka beppec56) 2006-07-27 21:16:23 UTC
Created attachment 38091 [details]
updated version, built against m178.
Comment 54 Giuseppe Castagno (aka beppec56) 2006-07-27 21:36:43 UTC
-> andreschnabel.
The patch doesn't touch the behaviour of the FileOpen/Close/SaveAs Windows dialog.
I checked it and as far as I can tell it runs.
After applying this patch an issue remain in a special circumstance:
1. begin with no OOo and no quickstart;
2. insert USB stick;
3. navigate to the OOo file and double click.
4. after you close  the file, you need to close OOo and the quickstart to umount
the stick.

But:
1. have the quickstart ready (at the logon, as per default install);
2. insert stick;
3. navigate to the file to open, double click;
4. after you close the file you'll be able to unmount the stick, leaving OOo and
quickstart in place.
Comment 55 Giuseppe Castagno (aka beppec56) 2006-07-27 21:38:55 UTC
Sorry I didn't mention how I checked:
Windows XP Home SP2, patch backported to OOo 2.0.3
Comment 56 ivaroo 2006-07-28 08:32:33 UTC
in reply to #55, see my comment #25.

Windows sets the current folder of the application to the folder where the file
comes from.
Comment 57 hennes.rohling 2006-08-17 15:45:44 UTC
In principle the patch is O.K. but I would prefer to remember the CWS before
every call to GetXXXFileName and reset it afterwards instead of defaulting to
the WINDOWS directory.

We'll try to fix this in the next release.
Comment 58 lohmaier 2006-08-20 22:39:58 UTC
*** Issue 68801 has been marked as a duplicate of this issue. ***
Comment 59 ace_dent 2006-09-11 10:54:37 UTC
*** Issue 69435 has been marked as a duplicate of this issue. ***
Comment 60 Giuseppe Castagno (aka beppec56) 2006-09-11 13:12:40 UTC
-> hro. Sorry, to be late in answering; anyway, what do you mean by CWS in
#desc58? I suppose it's the OOo Windows workspace, not the CWS in OOo
development slang, right?
I thought to force the working directory to the OOo binary directory (e.g. <OOo
dir>/program) since this is the only one that must be there throughout the OOo
run time, but then I couldn't devise a method to retrieve it from inside a win32
abstraction layer module (e.g. what OOo function to call).
May be I can help ? I have CVS and CWS ( OOo slang this time ;-) ) access.
Comment 61 ace_dent 2006-10-19 13:07:25 UTC
*** Issue 70577 has been marked as a duplicate of this issue. ***
Comment 62 kai.sommerfeld 2006-11-01 15:52:40 UTC
kso->all: hro is currently sick and will not be available before January 2007.
That's why there is currenly no actual activity here.
Comment 63 Mathias_Bauer 2006-11-03 15:52:34 UTC
As this issue is really important and we even have a patch already I tried to
find a replacement for hro. Thankfully mav will take this over. Target adjusted.
Comment 64 Mathias_Bauer 2006-11-03 15:57:16 UTC
Mikhail, though hro wanted to improve the patch a bit I think that we should no
longer wait or try to understand what he might have wanted to do. He said that
the patch looks OK and if you don't find a problem in it please apply it.

If hro wants to optimize something he can do it later but we shouldn't wait any
longer for getting this painful issue fixed (even if it is a Windows problem and
not an OOo problem).
Comment 65 mikhail.voytenko 2006-11-15 14:46:25 UTC
I have implemented the solution suggested by hro, and have used the patch
solution as a fallback.

mav->beppec56: As I understand, hro had meant the current directory when he had
used "CWS" term in his last comment, in other words he wanted to remember the
current directory before every call to GetXXXFileName and reset it afterwards.
Comment 66 mikhail.voytenko 2006-12-06 09:04:40 UTC
MAV->TM: Please verify the issue.
Comment 67 hennes.rohling 2006-12-06 13:37:35 UTC
*** Issue 69907 has been marked as a duplicate of this issue. ***
Comment 68 thorsten.martens 2006-12-12 09:36:02 UTC
Checked and verified in cws fwk56 -> OK !
Comment 69 Mathias_Bauer 2007-02-05 13:34:18 UTC
closing ancient issues
Comment 70 kpalagin 2007-02-15 07:58:49 UTC
*** Issue 74558 has been marked as a duplicate of this issue. ***
Comment 71 infratec 2008-04-11 13:55:38 UTC
Now version 2.4 is out.
The bug is still inside.
I used Win XP SP2 OOo 2.4.
Create a local directory,
copy a file to it,
open it with OO,
close it,
and you are not able to remove the directory
unless you close everything from OO.


Best regards,

Bernd
Comment 72 kai.sommerfeld 2008-04-11 17:02:55 UTC
Reopening.
Comment 73 kai.sommerfeld 2008-04-11 17:04:00 UTC
hro: Seems, that we managed to break the fix we once made. Please take a over.
Comment 74 hennes.rohling 2008-04-14 13:57:13 UTC
Accepted.
Comment 75 kai.sommerfeld 2008-06-30 14:18:04 UTC
hro: no time to fix this for 3.0. Sorry, need to re-target to 3.1.
Comment 76 andreschnabel 2008-12-03 14:18:54 UTC
*** Issue 96812 has been marked as a duplicate of this issue. ***
Comment 77 hennes.rohling 2009-01-21 10:23:35 UTC
Not enough time to fix for 3.1
Comment 78 kai.sommerfeld 2009-05-26 12:56:35 UTC
cd: Please take over.
Comment 79 carsten.driesner 2009-05-26 13:06:01 UTC
cd: I have to adapt the file picker for Windows 7. So it makes sense to fix this
issue, too.
Comment 80 carsten.driesner 2009-09-14 12:22:50 UTC
cd: I have too much issues to fix all of them for OOo 3.2.  Due to missing time
this issue must be moved to the next release OOo 3.3.
Comment 81 carsten.driesner 2010-08-18 10:56:15 UTC
cd->mav: Please take over. You fixed the issue some years ago and have a better
understanding what must be done/what could be broken.
Comment 82 mikhail.voytenko 2010-11-18 14:31:19 UTC
I can not reproduce the problem in OOo3.3.
Comment 83 mikhail.voytenko 2010-11-18 14:33:16 UTC
mav->tm: Please verify the issue in OOo3.3 and close it in case it is not
reproducible. Otherwise please send the issue to me back.
Comment 84 mikhail.voytenko 2010-11-18 14:35:05 UTC
adding me to CC list
Comment 85 Mechtilde 2010-11-28 18:20:51 UTC
worksforme -< closed