|
Post by rikky on Apr 17, 2023 9:26:25 GMT 1
Hello I have a folder with a folder in it with a folder in it with a file in it. I have a link folder2 pointing to the first folder If I ask for FILETYPE("/folder2/folder/folder/file") it responds with 1. Which means regular file. ls -al /folder2/folder/folder/file also does not show that "/folder2/folder/folder/file" is in fact "/folder/folder/folder/file" So I suppose that technically the response is correct. But it is not the outcome that is desired. I wanted a 6. My workaround for the moment is: FUNCTION ISLINK(string$) TYPE int 'returns 1 if true, 0 if not true. LOCAL var$
IF string$ = "" THEN RETURN 0 IF NOT(FILEEXISTS(string$)) THEN RETURN 0
var$ = REALPATH$(string$)
IF var$ = string$ THEN 'thisfile is not a link RETURN 0: ' NOT TRUE ELSE RETURN 1 ' TRUE END IF
END FUNCTION Rik.
|
|
|
Post by Pjot on Apr 17, 2023 15:34:50 GMT 1
Hi rikky, Unfortunately, I cannot reproduce your problem on my system The generated C code uses the lstat C function to determine the type of file. It therefore is expected to return a symbolic link if the file pointed to is a symbolic link. However, depending on kernel version and underlying file system type, I have noticed that results may vary. For example, if your filesystem is NFS then 'lstat' may return a different value. Can you specify the filesystem your issue is occurring on? Thanks, Peter
|
|
|
Post by rikky on Apr 17, 2023 16:15:21 GMT 1
Well, mount says : /dev/mmcblk0p2 on / type ext4 (rw,noatime) That probably means that it is a normal EXT4 system on an SD card, and ... .. oh .... fdisk says : The device contains 'ext4' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.
Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x6c6bda9a. I've messed up again, somehow I'm going to back up first and then report later.
|
|
|
Post by rikky on Apr 17, 2023 17:28:23 GMT 1
Im sorry but all this resulted in a Kernel Panic. Luckely I was prepared. Reporting now from another sd card with different OS.
But now that Im here ..
Lets test again on this different system.
... ehmm ... Same problem.
mount gives : /dev/mmcblk0p2 on / type ext4 (rw,noatime)
fdisk gives :
The old ext4 signature will be removed by a write command.
Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x4ae5e679.
This is a normal sd card with a standard official Raspbian installed via the recommended tool for this from which I forgot its name.
Well, at least we now know the cause.
I am not happy, but thanks nonetheless.
Rik.
|
|
|
Post by Pjot on Apr 17, 2023 17:49:53 GMT 1
I've messed up again, somehow No worries, that happens to me all the time The cause can be anything, varying from a flaky SD card, to an older bootmanager which does not recognize GPT label, or to some stupid boot virus. Hope you can sort it out, Peter
|
|
|
Post by alexfish on Apr 17, 2023 19:32:31 GMT 1
on RPI it could be a mix of EFI and or recent updates on the boot loader
@ Rik does anything show on the boot screen IE usb- blagh,
just query , possibles attaching usb-boot devices ? can check boot-loader from raspi-config
further , also check the card with gparted , see if there are other partitions in realm of - mmcblk0p2 device
Alex
|
|