-
March 2nd, 2012, 06:35 PM
#1
FreeFile(1) - what does Open 256+ really do?
The definition of file number in the Open file syntax states that a FileNumber of 256 through 511 is to be used for files accessible from other applications.
Does anybody know what this really means? What is the difference between opening a random file ... As 1 vs ... As 256?
Thanks!
-
March 2nd, 2012, 09:21 PM
#2
Re: FreeFile(1) - what does Open 256+ really do?
Where did you get that from?
FreeFile does not take a parameter. It returns the first available file number or an error if more than 255 file handles are currently in use.
http://msdn.microsoft.com/en-us/libr...(v=vs.90).aspx
I would expect open for input as #257 to crash with an error
Last edited by DataMiser; March 2nd, 2012 at 10:23 PM.
Always use [code][/code] tags when posting code.
-
March 2nd, 2012, 11:15 PM
#3
Re: FreeFile(1) - what does Open 256+ really do?
Pretty sure 8-bit file handles were still in use. 0-255
-
March 2nd, 2012, 11:39 PM
#4
Re: FreeFile(1) - what does Open 256+ really do?
I remember back in the days when it was not uncommon to only be able to have 3 or 4 open files at a time. Can't remember the exact syntax but there was a line in the cfg file to set max files and was almost always set to a number < 10
Always use [code][/code] tags when posting code.
-
March 3rd, 2012, 05:39 AM
#5
Re: FreeFile(1) - what does Open 256+ really do?
Ah... the olden days. Config.Sys, files=20, buffers=40...
-
March 4th, 2012, 09:52 PM
#6
Re: FreeFile(1) - what does Open 256+ really do?
I knew it had something to do with sys and cfg but I could not remember the name. Thankfully it has been a long time since I needed to edit one of these files. Now I have almost forgotten everything about it.
Always use [code][/code] tags when posting code.
-
March 5th, 2012, 08:44 AM
#7
Re: FreeFile(1) - what does Open 256+ really do?
Really? Are younger programmers that forgetful?
I must admit that I can remember the commands of my old CP/M system better than the .NET stuf I looked at last week.
I put that to WoF.System.Memory.Learning.Programming.NETstuff.Important.Recall again.
-
March 5th, 2012, 09:19 AM
#8
Re: FreeFile(1) - what does Open 256+ really do?
Its sad just how much my memory has went downhill in recent years. Used to be someone could talk with me for 10 minutes about a project and I would still remember the details 2 years later and now 10 minutes after the conversation I may not even remember having the conversation
I think I need to purcahse a new stick or 2
Always use [code][/code] tags when posting code.
-
March 5th, 2012, 02:57 PM
#9
Re: FreeFile(1) - what does Open 256+ really do?
While I do still remember the old open file limitations this does not have anything to do with that (besides the file numbers were limited to 1 to 255 back then).
This is in VB6. The help screen for the "Open" statement lists the filenumber parameter and then the link on filenumber shows: "Use file numbers in the range 1-255, inclusive, for files not accessible to other applications. Use file numbers in the range 256-511 for files accessible from other applications."
And the FreeFile function accept an optional parameter: 0 = returns 1 - 255, 1 = returns 256-511. (the optional parameter defaults to 0 so it returns 1-255 as it always did).
Somebody at Microsoft obviously did this for a reason but I cannot find any additional information on it and in testing files opened with high vs. low file number and I cannot see the difference.
-
March 5th, 2012, 03:24 PM
#10
Re: FreeFile(1) - what does Open 256+ really do?
After some searching I found the info in the Op but nothing to expand on it so I have no idea what a filenumber above 255 would do in VB6. It appears these filenumbers are not supported in later versions of VB and I was not aware they could be used in VB6 until now.
The only thing that makes sense from the little info that is provided would be if you are opening a file to allow shared access but I was under the impression that the shared option was the method which should be used for this so again I do not know.
My take would be to stick with normal filenumbers 1-255
Always use [code][/code] tags when posting code.
-
March 6th, 2012, 07:09 AM
#11
Re: FreeFile(1) - what does Open 256+ really do?
I must admit, I never heared about that optional parameter on FreeFile at all.
How do you share a file with another application anyway? One is reading it, the other is writing to it?
-
March 6th, 2012, 08:16 AM
#12
Re: FreeFile(1) - what does Open 256+ really do?
Originally Posted by DataMiser
After some searching I found the info in the Op but nothing to expand on it so I have no idea what a filenumber above 255 would do in VB6.
Could you post that link... I cant seem to find anything official..
only this obscure post where he says that Freefile(1) allows you to access the next 255 file numbers...
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
March 6th, 2012, 08:40 AM
#13
Re: FreeFile(1) - what does Open 256+ really do?
It is actually in the msdn help that came with VB6 under the Open Statement.
Here is a link related to VBA which says pretty much the same thing.
http://msdn.microsoft.com/en-us/libr...(v=vs.60).aspx
Always use [code][/code] tags when posting code.
-
March 6th, 2012, 01:53 PM
#14
Re: FreeFile(1) - what does Open 256+ really do?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|