KolibriOS Help [Back to list system function] [Previous page] [Next page]

System function 70 - Work with file system with long names support

Parameters:
Register eax = 70
Register ebx = pointer to the information structure
Returned value:
Register eax = 0 - success; otherwise file system error code some subfunctions return value in other registers too.
General format of the information structure:
+0: dword: subfunction number
+4: dword: offset in file or folder
+8: dword: higher part of offset or flags
+12 = +0xC: dword: size of data
+16 = +0x10: dword: pointer to data
+20 = +0x14: ?: path - zero terminated string
or
+20 = +0x14: byte: 0
+21 = +0x15: dword: pointer to string
Case sensitivity depends on filesystem.
If a path not begins with '/', it is considered a relative.
To get or set the current folder, use the sysfunction 30.
'../' in the path means a lift by one folder relatively current folder.
To set the encoding, put at the start of the string a byte with next values:
1 = cp866
2 = UTF-16LE
3 = UTF-8
otherwise will be used cp866. In an absolute path you may put this byte after the '/' or put an additional '/' before it.
Also, you may use the sysfunction 80.
Format of an absolute path: /base/number/dir1/dir2/.../dirn/file, where base/number identifies device, on which file is located:
RD/1 = ramdisk
FD/1 = first floppy drive, FD/2 = second floppy drive
HD0/x, HD1/x, HD2/x, HD3/x = hard drives accordingly on IDE0 (Primary Master), IDE1 (Primary Slave), IDE2 (Secondary Master), IDE3 (Secondary Slave); x - partition number on the selected hard drive, starts from 1
CD0/1, CD1/1, CD2/1, CD3/1 = same for cd
SYS = system folder (encoding inaffected key), second key may be set by sysfunction 30.3.
Examples:
'/sys/example.asm',0
'/rd/1/example.asm',0
'/HD0/1/folder/file.txt',0
'/hd2/2/pics/tanzania.bmp',0
2,'/',0,'sys','/',0,'F',0,'I',0,'L',0,'E',0,0,0

Available subfunctions:
subfunction 0 - read file
subfunction 1 - read folder
subfunction 2 - create/rewrite file
subfunction 3 - write to existing file
subfunction 4 - set file size
subfunction 5 - get attributes of file/folder
subfunction 6 - set attributes of file/folder
subfunction 7 - start application
subfunction 8 - delete file/folder
subfunction 9 - create folder
For CD-drives due to hardware limitations only subfunctions 0,1,5 and 7 are available, other subfunctions return error with code 2.
At the first call of subfunctions 0,1,5,7 to ATAPI devices(CD and DVD) the manual control of tray is locked due to caching drive data. Unlocking is made when subfunction 4 of function 24 is called for corresponding device.

Value for register eax - 70 (SF_FILE).
Values for register ebx:
0 - SSF_READ_FILE - subfunction 0 - read file with long names support.
1 - SSF_READ_FOLDER - subfunction 1 - read folder with long names support.
2 - SSF_CREATE_FILE - subfunction 2 - create/rewrite file with long names support.
3 - SSF_WRITE_FILE - subfunction 3 - write to existing file with long names support.
4 - SSF_SET_END - subfunction 4 - set end of file.
5 - SSF_GET_INFO - subfunction 5 - get information on file/folder.
6 - SSF_SET_INFO - subfunction 6 - set attributes of file/folder.
7 - SSF_START_APP - subfunction 7 - start application.
8 - SSF_DELETE - subfunction 8 - delete file/folder.
9 - SSF_CREATE_FOLDER - subfunction 9 - create folder.