I've coded a random access file to be created, and am wondering; Is the random access file stored on the RAM, or the hard drive? If it's the hard drive, why is it called a "Random Access" file? Thanks
Where are visual basic Random Access Files stored?
114 views Asked by user2696020 At
2
There are 2 answers
0
On
Random access has nothing to do with storage location (which for a file is the disk). It has to do with how you can access (read/write) that file content.
Random access means you can access any location in the file between the start and end, in any order, at any time. It's the opposite of sequential access, which means you can only access the file from start to end.
In other words, with random access you can read the last byte (or block of bytes) from the file, the first byte (or block), and then a byte or block from the middle somewhere. With sequential access, you have to read the first byte/block, then the second byte/block, then the third, and so on.
Random access is opposite to sequential access. Random file read / write is somewhat similar to accessing RAM. A file is a file, can be read into RAM, but stored in hard drive.