CPCWiki forum

General Category => Technical Support - General => Topic started by: Colday on 18:24, 18 February 19

Title: Changing the user on files
Post by: Colday on 18:24, 18 February 19
Hi all.


I acquired a disk (ostensibly blank) from a seller on eBay, however when I've changed the user to 229 via poke &a701,229 I can see quite a lot of deleted files.


Some of these are .bas and can therefore be loaded and then saved back to another disc once the user number has been returned to 0.


However, some have other suffixes. Is there a way to just change the user number (from 229 back to 0) on the same disc?


The files appear to be just type ins with a few what appear to be utilities. Nothing that is 'personal' or 'sensitive' in nature. One of the .bas files plays an assortment of tunes etc.


Would be interested to hear from you all.


Title: Re: Changing the user on files
Post by: the graveborn on 18:44, 18 February 19
Whilst the current user number is 229:

|ren,"0:name of destination file","name of source file"

I hope that that helps..! :)
Title: Re: Changing the user on files
Post by: Colday on 19:07, 18 February 19
I thank you sir.


Shall have a go at the as soon as the kids finish eating their dinner!
Title: Re: Changing the user on files
Post by: Colday on 19:21, 18 February 19
Ok, had a go at that.


States that 'sourcefile' cannot be found.


So, I'm in user 229, can see the file. Type in the above ¦ren command replacing with exact names.


Any other thoughts?


For me I find it odd it cannot see the source file...
Title: Re: Changing the user on files
Post by: the graveborn on 19:32, 18 February 19
Could you post exactly what you typed..?
Title: Re: Changing the user on files
Post by: Colday on 19:46, 18 February 19
Sure...


poke &a701,229


¦ren,"0:autocat.bas","autocat.bas"


And I get the file not found error.

Title: Re: Changing the user on files
Post by: Ast on 20:44, 18 February 19
Unfortunately, this couldn't work on cpc with xmem (or other rom card) using roms
Why ? The answer is simple because amsdos start adress will change when rom will be installed.


The best way to do it is



Ld hl,(#be7d) ; start amsdos adress
Inc hl
Ld a,user (0-255)
Ld (hl),a



Title: Re: Changing the user on files
Post by: Colday on 20:55, 18 February 19
Sorry, I'm a little confused.


It's just a basic bog standard 6128 and a basic bog standard Amsoft CF-2 disc.


I've no idea what code you've used Ast, or how to use it.
Title: Re: Changing the user on files
Post by: Ast on 21:39, 18 February 19
Sorry.. in basic


?hex$(Peek(&be7e))+hex$(peek(&be7d))


Take the adress and add 1


Then poke adress,user


Is it easier like that ?
Title: Re: Changing the user on files
Post by: Colday on 21:47, 18 February 19
Sorry Ast.


Not hugely more useful.


Let's pretend for a moment that I know nothing about anything about Amstrads or Basic or anything else.


How about you do a step by step method of changing the user number of a file from 229(deleted) to 0(usable).


Or basically, undeleting files.
Title: Re: Changing the user on files
Post by: the graveborn on 23:01, 18 February 19
I'm sorry, I don't know why what I suggested didn't work – and I did test it!(Albeit in an emulator.)

I'm sorry, but you'll likely have to wait for a more knowledgeable member of this forum to suggest something – my knowledge of the Amstrad CPC is very incomplete (I've never owned an Amstrad anything, but as there's an intersection between my interests and retroprogramming I've learnt a little of how to operate an Amstrad CPC by trial-and-(mostly...)error – evidently I need to learn more...)

Ps. I assume that you've tried what I suggested with other files on that disc..? And with other discs..?
Title: Re: Changing the user on files
Post by: Ast on 23:17, 18 February 19
&A701 was the user adress on a nude cpc. When you connect any romcard with actives rom running, this adress changes, but you could also find the correct one at be7d-be7e.


For example, on a nude cpc
Peek(&be7d)=0
Peek(&be7e)=&a7


So amsdos entry will start in &a700.


But when you simply connect a rom, this adress changes. Just try it !


&a701 is not universal.
Title: Re: Changing the user on files
Post by: Ast on 23:25, 18 February 19
To complete and finish, if you found &f4 at &be7d and &a6 at &be7e then amsdos entry will start at &a6f4 and not in &a700.


So your user adress will have to be poked at &a6f5.





Do you understand what i mean ?
Title: Re: Changing the user on files
Post by: GeoffB17 on 01:31, 19 February 19
Sorry to stick my nose in here, as I'm a PCW person and while I know a bit about CF2 disks, CP/M, disk directories etc, I know zilch about the CPC things you're discussing.

No problem doing what you're talking about using a disk editor.

BUT, I hope that OP is aware that you're seeing the directory entries, which may seem valid, but this is not to say that the actual data (sectors) that were once attached to the dir entries are still there, or contain the right data, or don't have chunks missing.   You could try what you're trying, and see what happens, but this could generate errors, i.e. two files linking to the same Allocation block.

If there were x files on the disk, and all were deleted, and then nothing new was written to the disk, then you could get 100% recovery.  But if anything new was written to the disk AFTER the files were deleted, then problems.   And if the NEW files were in turn deleted, then even more of a mess.   If I had the disk, I could follow thru the Allocation Block numbers and know for sure.

Fun!

Geoff
Title: Re: Changing the user on files
Post by: GUNHED on 15:46, 19 February 19
Quote from: Colday on 18:24, 18 February 19
Hi all.
I acquired a disk (ostensibly blank) from a seller on eBay, however when I've changed the user to 229 via poke &a701,229 I can see quite a lot of deleted files.
...
Would be interested to hear from you all.


There is a very easy way to change user numbers of files. You can use FutureOS for that. Use the REName function.

Title: Re: Changing the user on files
Post by: Ast on 16:31, 19 February 19

Here is a basic example

10 mode 2
20 a$=hex$(peek(&be7e))+hex$(peek(&be7d))
30 print "AmsDos entry : &";a$
40 poke val("&"+a$),0 ' 0 : drive A - 1 : drive B
50 poke val("&"+a$)+1,229 ' User
60 cat

A better way to learn new things.
Bye.
Powered by SMFPacks Menu Editor Mod