Author Topic: Changing the user on files  (Read 500 times)

0 Members and 1 Guest are viewing this topic.

Offline Colday

  • CPC464
  • **
  • Posts: 48
  • Country: gb
  • Liked: 18
  • Likes Given: 2
Changing the user on files
« on: 19: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.


« Last Edit: 15:27, 20 February 19 by Gryzor »

Offline the graveborn

  • CPC464
  • **
  • Posts: 15
  • Country: gb
    • the graveborn
  • Liked: 6
  • Likes Given: 6
Re: Changing the user on files
« Reply #1 on: 19:44, 18 February 19 »
Whilst the current user number is 229:

Code: [Select]
|ren,"0:name of destination file","name of source file"
I hope that that helps..! :)
« Last Edit: 00:25, 19 February 19 by the graveborn »

Offline Colday

  • CPC464
  • **
  • Posts: 48
  • Country: gb
  • Liked: 18
  • Likes Given: 2
Re: Changing the user on files
« Reply #2 on: 20:07, 18 February 19 »
I thank you sir.


Shall have a go at the as soon as the kids finish eating their dinner!

Offline Colday

  • CPC464
  • **
  • Posts: 48
  • Country: gb
  • Liked: 18
  • Likes Given: 2
Re: Changing the user on files
« Reply #3 on: 20: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...
« Last Edit: 20:24, 18 February 19 by Colday »

Offline the graveborn

  • CPC464
  • **
  • Posts: 15
  • Country: gb
    • the graveborn
  • Liked: 6
  • Likes Given: 6
Re: Changing the user on files
« Reply #4 on: 20:32, 18 February 19 »
Could you post exactly what you typed..?
« Last Edit: 00:40, 19 February 19 by the graveborn »

Offline Colday

  • CPC464
  • **
  • Posts: 48
  • Country: gb
  • Liked: 18
  • Likes Given: 2
Re: Changing the user on files
« Reply #5 on: 20:46, 18 February 19 »
Sure...


poke &a701,229


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


And I get the file not found error.


Offline Ast

  • 6128 Plus
  • ******
  • Posts: 981
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 753
  • Likes Given: 672
Re: Changing the user on files
« Reply #6 on: 21: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


Code: [Select]
Ld hl,(#be7d) ; start amsdos adress
Inc hl
Ld a,user (0-255)
Ld (hl),a


« Last Edit: 21:45, 18 February 19 by Ast »
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"


Amstrad Plus French Forum

All friends are welcomed !

Offline Colday

  • CPC464
  • **
  • Posts: 48
  • Country: gb
  • Liked: 18
  • Likes Given: 2
Re: Changing the user on files
« Reply #7 on: 21: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.

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 981
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 753
  • Likes Given: 672
Re: Changing the user on files
« Reply #8 on: 22: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 ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"


Amstrad Plus French Forum

All friends are welcomed !

Offline Colday

  • CPC464
  • **
  • Posts: 48
  • Country: gb
  • Liked: 18
  • Likes Given: 2
Re: Changing the user on files
« Reply #9 on: 22: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.

Offline the graveborn

  • CPC464
  • **
  • Posts: 15
  • Country: gb
    • the graveborn
  • Liked: 6
  • Likes Given: 6
Re: Changing the user on files
« Reply #10 on: 00:01, 19 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..?
« Last Edit: 01:30, 19 February 19 by the graveborn »

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 981
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 753
  • Likes Given: 672
Re: Changing the user on files
« Reply #11 on: 00:17, 19 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.
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"


Amstrad Plus French Forum

All friends are welcomed !

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 981
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 753
  • Likes Given: 672
Re: Changing the user on files
« Reply #12 on: 00:25, 19 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 ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"


Amstrad Plus French Forum

All friends are welcomed !

Offline GeoffB17

  • 6128 Plus
  • ******
  • Posts: 536
  • Country: gb
  • PCW since '85
  • Liked: 114
  • Likes Given: 7
Re: Changing the user on files
« Reply #13 on: 02: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

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.287
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 720
  • Likes Given: 1564
Re: Changing the user on files
« Reply #14 on: 16:46, 19 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.

http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 981
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 753
  • Likes Given: 672
Re: Changing the user on files
« Reply #15 on: 17:31, 19 February 19 »

Here is a basic example
Code: [Select]
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.
« Last Edit: 17:33, 19 February 19 by Ast »
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"


Amstrad Plus French Forum

All friends are welcomed !