doubt with /pc/

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

doubt with /pc/

Post by dospro »

When you try to open a file with /pc/, what pc dir are you really using? C:? the elf dir, dc-tool-ip dir, or what?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Post by BlueCrab »

If you're using linux or Mac OS X (or any other *nix), its generally /
If you're using Cygwin, its generally the directory that cygwin is installed in (C:\Cygwin)
If you're using MSYS/MinGW, its generally C:\
nogginthenog
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 21
Joined: Fri Mar 10, 2006 7:57 am
Has thanked: 0
Been thanked: 0

Post by nogginthenog »

I use the following in my Makefile (Cygwin here):

run: $(TARGET).bin
dc-tool.exe -b 115200 -c . -x "$(TARGET).bin"

The '-c' argument tells dc-tool to use the current folder.
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by dospro »

Problems with the /pc/ thing.
I am using kubuntu linux. I compiled all the dc toolchain and tools(sh, arm, kos, dc-tool-ip).
the problem is that i dont know where does /pc/ directs the program to.
supposdly it is to /(root).
but it is not working like that.

How can i know where is /pc/ taking me?

PD. Using dc-tool-ip 1.0.3 in linux and 1.0.4 on DC.
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by dospro »

Ok, i figured something weird.
/pc/ redirects me to the root (/).
What doesn't work is fopen.
Why isn't printf neither fopen working??
This is a KOS problem, isnt it? Supposdly KOs controls the standar lib.
Whats wrong?
Was my compilation that bad?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
User avatar
semicolo
Mental DCEmu
Mental DCEmu
Posts: 328
Joined: Mon Apr 25, 2005 1:02 pm
Location: Three-rivers canada
Has thanked: 0
Been thanked: 0
Contact:

Post by semicolo »

does the user that runs dctool have rights to open the files you want to ?

Watch for the path, it works by me.
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by dospro »

The file i tried to open is in the home directory, so it is suppose it is not protected.
i tried somethin likes this:

file=fopen("/pc/home/dospro/file", "rb");

And this doesnt open the file, even though the file is there.

What else can ia do?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
Ex-Cyber
DCEmu User with No Life
DCEmu User with No Life
Posts: 3641
Joined: Sat Feb 16, 2002 1:55 pm
Has thanked: 0
Been thanked: 0

Post by Ex-Cyber »

You can use strace to spy on system calls made by a Linux program, which includes file operations.

Are you sure you've declared the file descriptor correctly?
"You know, I have a great, wonderful, really original method of teaching antitrust law, and it kept 80 percent of the students awake. They learned things. It was fabulous." -- Justice Stephen Breyer
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by dospro »

Well, still a stranger thing.
/cd/file doesnt work either.
It doesnt even read the cd inserted.

hell..
why is this??
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by dospro »

Well. is there an alternative to fopen?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
Post Reply