Recent

Author Topic: File access. (BlockRead / BlockWrite)  (Read 6604 times)

matthijs

  • Hero Member
  • *****
  • Posts: 537
File access. (BlockRead / BlockWrite)
« on: February 03, 2005, 02:29:57 pm »
I'm just a beginner in programming under Linux, so bear with me if I overlook something obvious. :) When I try my sample code from
this
topic under Windows, it runs fine.
If I run the same code under Linux I get a error " Access denied". This happens on the line
Code: [Select]
reset(SourceF); I am sure I have got enough rights to perform the copy-ing (using a file in my own home dir. So what goes wrong?

[edit]
I did some further testing, After creating a file by save a memo to file. I came a little bit further. Now the program stops at
Code: [Select]
     BlockWrite(destF, aBuffer, readCount, writeCount);
And says: "Privileged instruction".
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

Anonymous

  • Guest
File access. (BlockRead / BlockWrite)
« Reply #1 on: February 03, 2005, 09:48:49 pm »
Ha Ha, everything is harder in windows if you need to just copy a directory and sub directory and you
do not care if it is linux only use a exec command to do a  "cp -r /somedir /somedestdir", I line of code
can get her done. Same goes with the other hundreds of commands available on a linux system, take wget for
instance. Say you want your program to be able to suck all the pages off a web site just do a exec on wget www.somedomain.com .  

http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg02908.html

matthijs

  • Hero Member
  • *****
  • Posts: 537
File access. (BlockRead / BlockWrite)
« Reply #2 on: February 04, 2005, 05:17:57 pm »
Well, I know there are external commands under Linux which make live a lot easier then under Windows, but ...
I'm trying to write an article for a Dutch magazine focused on Pascal, Delphi/Kylix and the likes. Sample codes should work under Windows aswell as under Linux.

So my question still stands: Why do a get a "Privileged Instruction" error in the BlockWrite-statement?
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

 

TinyPortal © 2005-2018