Re: Can someone explain how a App on a Network server works?
From: Stefan Berglund (keepit_at_in.thegroups)
Date: 03/02/04
- Next message: Guy Cohen: "Dialing properties"
- Previous message: Steven Burn: "Re: Help! Error Copying Command$ as a File"
- In reply to: Tony Proctor: "Re: Can someone explain how a App on a Network server works?"
- Next in thread: Tony Proctor: "Re: Can someone explain how a App on a Network server works?"
- Reply: Tony Proctor: "Re: Can someone explain how a App on a Network server works?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 02 Mar 2004 10:05:51 -0800
On Tue, 2 Mar 2004 10:19:21 -0000, "Tony Proctor" <tony_proctor@aimtechnology_NOSPAM.com> wrote:
in <#upQK#DAEHA.2180@TK2MSFTNGP09.phx.gbl>
>When you execute a normal EXE on a local drive, the O/S actually "memory
>maps" the code from the *.exe file, thus making it appear as part of the
>process virtual address space, and then passes control to it. Note that this
>is different to it actually being loaded into RAM, or "physical memory". As
>sections of that code are executed, the normal virtual memory paging brings
>the relevant bit of code into physical memory on demand, as they're needed.
>
>Although memory mapping can load a file from a network drive, I believe the
>file content is first fetched across the network into a local temporary
>file, and then memory mapped (all quietly, behind the scenes). This is
>because the virtual memory paging would be at a lower-level in the O/S than
>network access, and so cannot access a non-local disk.
>
>An EXE file is usually marked as "busy" when being executed because the code
>is being loaded into RAM on-demand, and the O/S has to prevent anything not
>yet loaded from being changed, or moved, before it gets to it. I find it
>annoying that this locking also seems to prevent a rename operation too,
>which isn't really modifying any data. Under UNIX, your can perform a 'mv'
>command on an executing program with no problems.
>
>I'm not aware of any XP differences in this area. I'm not running XP here so
>maybe someone else can tell me if you can successfully rename an executing
>local file. If it only works when executing a remote file then it sounds
>like the *whole* file is being fetched across the network, and the busy lock
>released on it before memory mapping the local version. I'm guessing here
>though.
>
> Tony Proctor
Yes it is possible to rename an executing file on W2K, but the
same code fails on 9x systems. Not tested on XP, but I'd assume
it would be similar to W2K. I abandoned this method for one employing
two exes since my code needs to run on 9x systems also.
Try it yourself:
Private Sub Command1_Click()
'delete old version if it exists
If (Dir(App.Path & "\" & App.EXEName & ".old") <> "") Then Kill App.Path & "\" & App.EXEName & ".old"
'rename the current exe file
Name App.Path & "\" & App.EXEName & ".exe" As App.Path & "\" & App.EXEName & ".old"
'rename the new (downloaded) exe file
' Name sUpdateExe As App.Path & "\" & App.EXEName & ".exe"
Name App.Path & "\test1.exe" As App.Path & "\" & App.EXEName & ".exe"
'unload this version
Unload Me
'transfer control to the new version
Shell App.Path & "\" & App.EXEName & ".exe", vbNormalFocus
End Sub
- Next message: Guy Cohen: "Dialing properties"
- Previous message: Steven Burn: "Re: Help! Error Copying Command$ as a File"
- In reply to: Tony Proctor: "Re: Can someone explain how a App on a Network server works?"
- Next in thread: Tony Proctor: "Re: Can someone explain how a App on a Network server works?"
- Reply: Tony Proctor: "Re: Can someone explain how a App on a Network server works?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|