Skip to content

Commit

Permalink
Merge pull request #440 from antoinevg/antoinevg/fix-windows-permissi…
Browse files Browse the repository at this point in the history
…on-denied

logic: fix permission denied error on windows when capturing to sigrok
  • Loading branch information
mossmann authored Oct 3, 2024
2 parents e3ef64f + ae9fce1 commit 64109f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion host/greatfet/commands/greatfet_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def main():
except:
holding_dir = None

bin_file = tempfile.NamedTemporaryFile(dir=holding_dir)
bin_file = tempfile.NamedTemporaryFile(dir=holding_dir, delete=False)
bin_file_name = bin_file.name

# Create queues of transfer objects that we'll use as a producer/consumer interface for our comm thread.
Expand Down Expand Up @@ -333,13 +333,15 @@ def main():
# Flush whatever data we've read to disk, so it can be correctly read by subsequent operations.
if args.pulseview:
bin_file.flush()
bin_file.close()

# Finally, generate our output.
if args.binary:
log_function("Binary data written to file '{}'.".format(args.binary))
if args.pulseview:
emit_sigrok_file(args.pulseview, bin_file_name, bus_width, sample_rate, args.first_pin, channel_names)
log_function("Sigrok/PulseView compatible session file created: '{}'.".format(args.pulseview))
os.unlink(bin_file_name)

# Print how long we sampled for, as a nicety.
log_function("Sampled for {} seconds.".format(round(elapsed_time, 4)))
Expand Down

0 comments on commit 64109f7

Please sign in to comment.