You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4 cpus, 64bit, little endian, Intel(R) Core(TM) 7 150U
Memory
7.66GB/15.31GB
V executable
/opt/v/v
V last modified time
2025-01-06 10:27:48
V home dir
OK, value: /opt/v
VMODULES
OK, value: /home/venomega/.vmodules
VTMP
OK, value: /tmp/v_1000
Current working dir
OK, value: /home/venomega/vsync/src
Git version
git version 2.47.1
V git status
Error: fatal: bad revision 'HEAD'
.git/config present
true
cc version
cc (GCC) 14.2.1 20240910
gcc version
gcc (GCC) 14.2.1 20240910
clang version
clang version 18.1.8
tcc version
tcc version 0.9.28rc 2024-07-31 HEAD@1cee0908 (x86_64 Linux)
tcc git status
N/A
emcc version
N/A
glibc version
ldd (GNU libc) 2.40
What did you do? ./v -g -o vdbg cmd/v && ./vdbg main.v && main
modulemainimportosimportmathimportprantlf.cargs { parse, Input }
// Declare a structure with all command-line options.structOpts {
output string
indent int
pretty bool
}
// Describe usage of the command-line tool.fnparsero() ! (&Opts, []string) {
usage:='Converts YAML input to JSON output.Usage: yaml2json [options] [<yaml-file>] <yaml-file> read the YAML input from a fileOptions: -o|--output <file> write the JSON output to a file -i|--indent <count> write the JSON output to a file -p|--pretty print the JSON output with line breaks and indented -V|--version print the version of the executable and exit -h|--help print the usage information and exitIf no input file is specified, it will be read from standard input.Examples: $ yaml2json config.yaml -o config.json -p $ cat config.yaml | yaml2json > config.json'// Parse command-line options and arguments.opts, args:= parse[Opts](usage, Input{ version: '0.0.1' })!//return opts, argsreturn opts, args
}
fnmain(){
_, args:=parsero()!if args.len !=2 {
logerr("you need to specify source and destination args")
}
source:= args[0]
mutdestination:= args[1]
// logica del destinoif os.is_dir(destination){
destination= destination +"/"+ os.base(source)
}
mutsource_fd:= os.open(source) or {
panic("Error opening ${source}")
}
println("Source: "+ source +"\nDestination: "+ destination)
mutdestination_fd:= os.open_append(destination) or {
panic("Can't open file ${destination} for writing")
}
//seekingaaa:= destination_fd.tell() !if aaa >0{
source_fd.seek(aaa, os.SeekMode.start ) or {
panic("Can't seek ${source}")
}
}
source_stats:= os.stat(source) !if source_stats.size < aaa{
panic("Seems like you are trying to mirror not same source & destination file, if you are sure remove destination first.")
}
//writingmuttotal_length:= aaa
mutlast:=0for {
lop:= source_fd.tell() !if last <= lop {
last=int(lop)
}else{
break
}
nn:= source_stats.size - source_fd.tell() !min, _:= math.minmax(nn, 3333)
buff:= source_fd.read_bytes_at(int(min), u64(total_length))
n:= buff.len
if n >0{
destination_fd.write(buff) or {
panic("Can't write to ${destination}")
}
total_length += n
//source_fd.seek(total_length, os.SeekMode.start) or {// panic("Can't seek source ${source}")//}
}else{
break
}
print("\b\b\b${total_length * 100 / source_stats.size}%")
}
println("Exited")
}
fnlogerr(s string) {
println(s)
exit (1)
}
fnmain2() {
}
What did you see?
you need to specify source and destination args
What did you expect to see?
this code should translate to C, it says error when used with 'v main.v -o main.o'
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered:
V version: V 0.4.9 2aa5651, press to see full `v doctor` output
What did you do?
./v -g -o vdbg cmd/v && ./vdbg main.v && main
What did you see?
What did you expect to see?
this code should translate to C, it says error when used with 'v main.v -o main.o'
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: